Class: Xail::ContainsFilter
- Inherits:
-
AbstractFilter
- Object
- AbstractFilter
- Xail::ContainsFilter
- Defined in:
- lib/xail/filter.rb
Instance Method Summary collapse
-
#initialize(*keys) ⇒ ContainsFilter
constructor
A new instance of ContainsFilter.
- #streamLine(line) ⇒ Object
Methods inherited from AbstractFilter
Constructor Details
#initialize(*keys) ⇒ ContainsFilter
Returns a new instance of ContainsFilter.
156 157 158 |
# File 'lib/xail/filter.rb', line 156 def initialize(*keys) @keys = keys end |
Instance Method Details
#streamLine(line) ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/xail/filter.rb', line 160 def streamLine(line) @keys.each do |key| if key.instance_of? Regexp and line[key] return line elsif key.instance_of? String and line.downcase.include? key.downcase return line end end nil end |