Class: Arrow::SparseUnionDataType
- Inherits:
-
Object
- Object
- Arrow::SparseUnionDataType
- Defined in:
- lib/arrow/sparse-union-data-type.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ SparseUnionDataType
constructor
Creates a new SparseUnionDataType.
Constructor Details
#initialize(fields, type_codes) ⇒ SparseUnionDataType #initialize(description) ⇒ SparseUnionDataType
Creates a new Arrow::SparseUnionDataType.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/arrow/sparse-union-data-type.rb', line 70 def initialize(*args) n_args = args.size case n_args when 1 description = args[0] fields = description[:fields] type_codes = description[:type_codes] when 2 fields, type_codes = args else = "wrong number of arguments (given, #{n_args}, expected 1..2)" raise ArgumentError, end fields = fields.collect do |field| field = Field.new(field) unless field.is_a?(Field) field end initialize_raw(fields, type_codes) end |