Class: ArrowFormat::StructType

Inherits:
Type
  • Object
show all
Defined in:
lib/arrow-format/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(children) ⇒ StructType

Returns a new instance of StructType.



886
887
888
889
# File 'lib/arrow-format/type.rb', line 886

def initialize(children)
  super()
  @children = children
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



885
886
887
# File 'lib/arrow-format/type.rb', line 885

def children
  @children
end

Instance Method Details

#build_array(size, validity_buffer, children) ⇒ Object



895
896
897
# File 'lib/arrow-format/type.rb', line 895

def build_array(size, validity_buffer, children)
  StructArray.new(self, size, validity_buffer, children)
end

#nameObject



891
892
893
# File 'lib/arrow-format/type.rb', line 891

def name
  "Struct"
end

#to_flatbuffersObject



906
907
908
# File 'lib/arrow-format/type.rb', line 906

def to_flatbuffers
  FB::Struct::Data.new
end

#to_sObject



899
900
901
902
903
904
# File 'lib/arrow-format/type.rb', line 899

def to_s
  fields = children.collect do |child|
    "#{child.name}: #{child.type}"
  end
  "#{super}<#{fields.join(", ")}>"
end