Class: Arrow::Slicer::RejectCondition

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

Instance Method Summary collapse

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

#evaluateObject



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