Class: Arrow::Slicer::EqualCondition
- Defined in:
- lib/arrow/slicer.rb
Instance Method Summary collapse
- #!@ ⇒ Object
- #evaluate ⇒ Object
-
#initialize(column, value) ⇒ EqualCondition
constructor
A new instance of EqualCondition.
Methods inherited from Condition
Constructor Details
#initialize(column, value) ⇒ EqualCondition
Returns a new instance of EqualCondition.
215 216 217 218 |
# File 'lib/arrow/slicer.rb', line 215 def initialize(column, value) @column = column @value = value end |
Instance Method Details
#!@ ⇒ Object
220 221 222 |
# File 'lib/arrow/slicer.rb', line 220 def !@ NotEqualCondition.new(@column, @value) end |
#evaluate ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/arrow/slicer.rb', line 224 def evaluate case @value when nil raw_array = @column.collect(&:nil?) 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 |