Class: Yuriita::DynamicFilter
- Inherits:
-
Object
- Object
- Yuriita::DynamicFilter
- Defined in:
- lib/yuriita/dynamic_filter.rb
Instance Attribute Summary collapse
-
#qualifier ⇒ Object
readonly
Returns the value of attribute qualifier.
Instance Method Summary collapse
- #apply(relation, input) ⇒ Object
-
#initialize(qualifier:, &block) ⇒ DynamicFilter
constructor
A new instance of DynamicFilter.
Constructor Details
#initialize(qualifier:, &block) ⇒ DynamicFilter
Returns a new instance of DynamicFilter.
5 6 7 8 |
# File 'lib/yuriita/dynamic_filter.rb', line 5 def initialize(qualifier:, &block) @qualifier = qualifier @block = block end |
Instance Attribute Details
#qualifier ⇒ Object (readonly)
Returns the value of attribute qualifier.
3 4 5 |
# File 'lib/yuriita/dynamic_filter.rb', line 3 def qualifier @qualifier end |
Instance Method Details
#apply(relation, input) ⇒ Object
10 11 12 |
# File 'lib/yuriita/dynamic_filter.rb', line 10 def apply(relation, input) block.call(relation, input) end |