Class: Lf::Filter::Eq
- Inherits:
-
Lf::Filter
- Object
- Lf::Filter
- Lf::Filter::Eq
- Defined in:
- lib/lf/filter/eq.rb
Constant Summary
Constants inherited from Lf::Filter
Instance Method Summary collapse
- #apply(row) ⇒ Object
-
#initialize(arg) ⇒ Eq
constructor
A new instance of Eq.
Methods inherited from Lf::Filter
[], []=, filter_alias, inherited, parse
Constructor Details
#initialize(arg) ⇒ Eq
Returns a new instance of Eq.
4 5 6 |
# File 'lib/lf/filter/eq.rb', line 4 def initialize(arg) @label, @value = *arg.split(':') end |
Instance Method Details
#apply(row) ⇒ Object
8 9 10 |
# File 'lib/lf/filter/eq.rb', line 8 def apply(row) row[@label.to_s.to_sym].to_s == @value ? row : nil end |