Class: Arrow::ListSliceOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/list-slice-options.rb

Constant Summary collapse

RETURN_FIXED_SIZE_GLIB_TO_RUBY =
{
  ListSliceReturnFixedSizeList::AUTO => nil,
  ListSliceReturnFixedSizeList::TRUE => true,
  ListSliceReturnFixedSizeList::FALSE => false,
}.freeze
RETURN_FIXED_SIZE_RUBY_TO_GLIB =
RETURN_FIXED_SIZE_GLIB_TO_RUBY.invert.freeze

Instance Method Summary collapse

Instance Method Details

#return_fixed_size_listObject

Whether to return a FixedSizeListArray. If true and stop is after a list element’s length, nil values will be appended to create the requested slice size. The default of nil will return the same type which was passed in.

Since:

  • 23.0.0



36
37
38
39
40
# File 'lib/arrow/list-slice-options.rb', line 36

def return_fixed_size_list
  RETURN_FIXED_SIZE_GLIB_TO_RUBY.fetch(
    return_fixed_size_list_raw,
    return_fixed_size_list_raw)
end

#return_fixed_size_list=(return_fixed_size_list) ⇒ Object

Whether to return a FixedSizeListArray. If true and stop is after a list element’s length, nil values will be appended to create the requested slice size. The default of nil will return the same type which was passed in.

Since:

  • 23.0.0



50
51
52
53
54
# File 'lib/arrow/list-slice-options.rb', line 50

def return_fixed_size_list=(return_fixed_size_list)
  self.return_fixed_size_list_raw = RETURN_FIXED_SIZE_RUBY_TO_GLIB.fetch(
    return_fixed_size_list,
    return_fixed_size_list)
end

#stopObject

Optional stop of list slicing. If set to nil, then slice to end.

Since:

  • 23.0.0



62
63
64
# File 'lib/arrow/list-slice-options.rb', line 62

def stop
  stop_raw == LIST_SLICE_OPTIONS_STOP_UNSPECIFIED ? nil : stop_raw
end

#stop=(stop) ⇒ Object

Optional stop of list slicing. If set to nil, then slice to end.

Since:

  • 23.0.0



72
73
74
# File 'lib/arrow/list-slice-options.rb', line 72

def stop=(stop)
  self.stop_raw = stop.nil? ? LIST_SLICE_OPTIONS_STOP_UNSPECIFIED : stop
end