Class: Arrow::MakeStructOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/make-struct-options.rb

Class Method Summary collapse

Class Method Details

.try_convert(value) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/arrow/make-struct-options.rb', line 21

def try_convert(value)
  case value
  when Hash
    options = new
    field_names = value[:field_names] || []
    field_nullability = value[:field_nullability] || []
     = value[:field_metadata] || []
    field_names.zip(field_nullability, ) do |name, nullability, |
      options.add_field(name, nullability, )
    end
    options
  else
    nil
  end
end