Class: Threatinator::Filters::Whitespace
- Inherits:
-
Threatinator::Filter
- Object
- Threatinator::Filter
- Threatinator::Filters::Whitespace
- Defined in:
- lib/threatinator/filters/whitespace.rb
Overview
Filters on any lines of text that consist entirely of whitespace
Instance Method Summary collapse
-
#filter?(record) ⇒ Boolean
True if filtered, false otherwise.
-
#initialize ⇒ Whitespace
constructor
A new instance of Whitespace.
Constructor Details
#initialize ⇒ Whitespace
Returns a new instance of Whitespace.
7 8 9 |
# File 'lib/threatinator/filters/whitespace.rb', line 7 def initialize() @re = /^\s*$/ end |
Instance Method Details
#filter?(record) ⇒ Boolean
Returns true if filtered, false otherwise.
13 14 15 |
# File 'lib/threatinator/filters/whitespace.rb', line 13 def filter?(record) !! @re.match(record.data) end |