Class: Lf::Filter::Eq

Inherits:
Lf::Filter show all
Defined in:
lib/lf/filter/eq.rb

Constant Summary

Constants inherited from Lf::Filter

FILTERS

Instance Method Summary collapse

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