Class: Threatinator::Filters::Block
- Inherits:
-
Threatinator::Filter
- Object
- Threatinator::Filter
- Threatinator::Filters::Block
- Defined in:
- lib/threatinator/filters/block.rb
Overview
Basic filter that allows for arbitrary filtering.
Instance Method Summary collapse
-
#filter?(record) ⇒ Boolean
True if filtered, false otherwise.
-
#initialize(block) ⇒ Block
constructor
A new instance of Block.
Constructor Details
#initialize(block) ⇒ Block
Returns a new instance of Block.
7 8 9 |
# File 'lib/threatinator/filters/block.rb', line 7 def initialize(block) @block = block end |
Instance Method Details
#filter?(record) ⇒ Boolean
Returns true if filtered, false otherwise.
13 14 15 |
# File 'lib/threatinator/filters/block.rb', line 13 def filter?(record) !! @block.call(record) end |