Class: Arrow::Slicer::InCondition
- Defined in:
- lib/arrow/slicer.rb
Instance Method Summary collapse
- #!@ ⇒ Object
- #evaluate ⇒ Object
-
#initialize(column, values) ⇒ InCondition
constructor
A new instance of InCondition.
Methods inherited from Condition
Constructor Details
#initialize(column, values) ⇒ InCondition
Returns a new instance of InCondition.
365 366 367 368 |
# File 'lib/arrow/slicer.rb', line 365 def initialize(column, values) @column = column @values = values end |
Instance Method Details
#!@ ⇒ Object
370 371 372 |
# File 'lib/arrow/slicer.rb', line 370 def !@ NotInCondition.new(@column, @values) end |
#evaluate ⇒ Object
374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/arrow/slicer.rb', line 374 def evaluate values_index = {} @values.each do |value| values_index[value] = true end raw_array = @column.collect do |value| if value.nil? nil else values_index.key?(value) end end BooleanArray.new(raw_array) end |