Class: Kadmin::Finder::Filter
- Inherits:
-
Object
- Object
- Kadmin::Finder::Filter
- Defined in:
- app/components/kadmin/finder/filter.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #apply(scope, value) ⇒ Object
-
#initialize(name, scope) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
#initialize(name, scope) ⇒ Filter
Returns a new instance of Filter.
9 10 11 12 13 |
# File 'app/components/kadmin/finder/filter.rb', line 9 def initialize(name, scope) @name = name @scope = scope @value = nil end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'app/components/kadmin/finder/filter.rb', line 6 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'app/components/kadmin/finder/filter.rb', line 7 def value @value end |
Instance Method Details
#apply(scope, value) ⇒ Object
15 16 17 18 |
# File 'app/components/kadmin/finder/filter.rb', line 15 def apply(scope, value) @value = value scope.merge(scope.instance_exec(value, &@scope)) end |