Class: Arrow::StructDataType
- Inherits:
-
Object
- Object
- Arrow::StructDataType
- Includes:
- FieldContainable
- Defined in:
- lib/arrow/struct-data-type.rb
Instance Method Summary collapse
-
#initialize(fields) ⇒ StructDataType
constructor
Creates a new StructDataType.
Methods included from FieldContainable
Constructor Details
#initialize(fields) ⇒ StructDataType #initialize(fields) ⇒ StructDataType #initialize(description) ⇒ StructDataType
Creates a new Arrow::StructDataType.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/arrow/struct-data-type.rb', line 108 def initialize(fields) if fields.is_a?(Hash) and fields.key?(:fields) description = fields fields = description[:fields] end if fields.is_a?(Hash) fields = fields.collect do |name, data_type| Field.new(name, data_type) end else fields = fields.collect do |field| field = Field.new(field) unless field.is_a?(Field) field end end initialize_raw(fields) end |