Class: Arrow::Slicer::RejectCondition
- Defined in:
- lib/arrow/slicer.rb
Instance Method Summary collapse
- #!@ ⇒ Object
- #evaluate ⇒ Object
-
#initialize(column, block) ⇒ RejectCondition
constructor
A new instance of RejectCondition.
Methods inherited from Condition
Constructor Details
#initialize(column, block) ⇒ RejectCondition
Returns a new instance of RejectCondition.
432 433 434 435 |
# File 'lib/arrow/slicer.rb', line 432 def initialize(column, block) @column = column @block = block end |
Instance Method Details
#!@ ⇒ Object
437 438 439 |
# File 'lib/arrow/slicer.rb', line 437 def !@ SelectCondition.new(@column, @block) end |
#evaluate ⇒ Object
441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/arrow/slicer.rb', line 441 def evaluate raw_array = @column.collect do |value| evaluated_value = @block.call(value) if evaluated_value.nil? nil else not evaluated_value end end BooleanArray.new(raw_array) end |