Class: ArrowFormat::UnionArray
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#types_buffer ⇒ Object
readonly
Returns the value of attribute types_buffer.
Attributes inherited from Array
#offset, #size, #type, #validity_buffer
Instance Method Summary collapse
- #each_type(&block) ⇒ Object
-
#initialize(type, size, types_buffer, children) ⇒ UnionArray
constructor
A new instance of UnionArray.
Methods inherited from Array
#empty?, #n_nulls, #null?, #slice, #valid?
Constructor Details
#initialize(type, size, types_buffer, children) ⇒ UnionArray
Returns a new instance of UnionArray.
696 697 698 699 700 |
# File 'lib/arrow-format/array.rb', line 696 def initialize(type, size, types_buffer, children) super(type, size, nil) @types_buffer = types_buffer @children = children end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
695 696 697 |
# File 'lib/arrow-format/array.rb', line 695 def children @children end |
#types_buffer ⇒ Object (readonly)
Returns the value of attribute types_buffer.
694 695 696 |
# File 'lib/arrow-format/array.rb', line 694 def types_buffer @types_buffer end |
Instance Method Details
#each_type(&block) ⇒ Object
702 703 704 705 706 707 708 709 710 711 712 |
# File 'lib/arrow-format/array.rb', line 702 def each_type(&block) return [].each(&block) if empty? return to_enum(__method__) unless block_given? @types_buffer.each(type_buffer_type, type_element_size * @offset, @size) do |_, type| yield(type) end end |