Class: Threatinator::Filters::Block

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

Overview

Basic filter that allows for arbitrary filtering.

Instance Method Summary collapse

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.

Parameters:

Returns:

  • (Boolean)

    true if filtered, false otherwise.



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

def filter?(record)
  !! @block.call(record)
end