Class: Tornados::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/tornados/filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(lambda) ⇒ Filter

Returns a new instance of Filter.



11
12
13
# File 'lib/tornados/filter.rb', line 11

def initialize(lambda)
  @condition = lambda
end

Instance Method Details

#accept?(checked_value) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/tornados/filter.rb', line 15

def accept?(checked_value)
  condition.call(checked_value)
end