Module: Arrow::GenericTakeable

Included in:
Array, ChunkedArray, Table
Defined in:
lib/arrow/generic-takeable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



21
22
23
24
# File 'lib/arrow/generic-takeable.rb', line 21

def included(base)
  base.__send__(:alias_method, :take_raw, :take)
  base.__send__(:alias_method, :take, :take_generic)
end

Instance Method Details

#take_generic(indices) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/arrow/generic-takeable.rb', line 27

def take_generic(indices)
  case indices
  when ::Array
    take_raw(IntArrayBuilder.build(indices))
  when ChunkedArray
    take_chunked_array(indices)
  else
    take_raw(indices)
  end
end