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.



333
334
335
336
# File 'lib/arrow/slicer.rb', line 333

def initialize(column, block)
  @column = column
  @block = block
end

Instance Method Details

#!@Object



338
339
340
# File 'lib/arrow/slicer.rb', line 338

def !@
  SelectCondition.new(@column, @block)
end

#evaluateObject



342
343
344
345
346
347
348
349
350
351
352
# File 'lib/arrow/slicer.rb', line 342

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