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.
367 368 369 370 |
# File 'lib/arrow/slicer.rb', line 367 def initialize(column, block) @column = column @block = block end |
Instance Method Details
#!@ ⇒ Object
372 373 374 |
# File 'lib/arrow/slicer.rb', line 372 def !@ SelectCondition.new(@column, @block) end |
#evaluate ⇒ Object
376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/arrow/slicer.rb', line 376 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 |