Class: Threatinator::Filters::Whitespace

Inherits:
Threatinator::Filter show all
Defined in:
lib/threatinator/filters/whitespace.rb

Overview

Filters on any lines of text that consist entirely of whitespace

Instance Method Summary collapse

Constructor Details

#initializeWhitespace

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.

Parameters:

Returns:

  • (Boolean)

    true if filtered, false otherwise.



13
14
15
# File 'lib/threatinator/filters/whitespace.rb', line 13

def filter?(record)
  !! @re.match(record.data)
end