Class: Arrow::Slicer

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/slicer.rb

Overview

Experimental

TODO: Almost codes should be implemented in Apache Arrow C++.

Defined Under Namespace

Classes: AndCondition, ColumnCondition, Condition, EqualCondition, GreaterCondition, GreaterEqualCondition, InCondition, LessCondition, LessEqualCondition, LogicalCondition, NotColumnCondition, NotEqualCondition, NotInCondition, OrCondition, RejectCondition, SelectCondition, XorCondition

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ Slicer

Returns a new instance of Slicer.



23
24
25
# File 'lib/arrow/slicer.rb', line 23

def initialize(table)
  @table = table
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/arrow/slicer.rb', line 38

def method_missing(name, *args, &block)
  if args.empty?
    column_condition = self[name]
    return column_condition if column_condition
  end
  super
end

Instance Method Details

#[](column_name) ⇒ Object



27
28
29
30
31
# File 'lib/arrow/slicer.rb', line 27

def [](column_name)
  column = @table[column_name]
  return nil if column.nil?
  ColumnCondition.new(column)
end

#respond_to_missing?(name, include_private) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/arrow/slicer.rb', line 33

def respond_to_missing?(name, include_private)
  return true if self[name]
  super
end