Class: Arrow::Slicer::NotEqualCondition
- Defined in:
- lib/arrow/slicer.rb
Instance Method Summary collapse
- #!@ ⇒ Object
- #evaluate ⇒ Object
-
#initialize(column, value) ⇒ NotEqualCondition
constructor
A new instance of NotEqualCondition.
Methods inherited from Condition
Constructor Details
#initialize(column, value) ⇒ NotEqualCondition
Returns a new instance of NotEqualCondition.
243 244 245 246 |
# File 'lib/arrow/slicer.rb', line 243 def initialize(column, value) @column = column @value = value end |
Instance Method Details
#!@ ⇒ Object
248 249 250 |
# File 'lib/arrow/slicer.rb', line 248 def !@ EqualCondition.new(@column, @value) end |
#evaluate ⇒ Object
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/arrow/slicer.rb', line 252 def evaluate case @value when nil if @column.n_nulls.zero? raw_array = [true] * @column.length else raw_array = @column.length.times.collect do |i| @column.valid?(i) end end BooleanArray.new(raw_array) else raw_array = @column.collect do |value| if value.nil? nil else @value != value end end BooleanArray.new(raw_array) end end |