Class: Filterameter::Filters::ScopeFilter
- Inherits:
-
Object
- Object
- Filterameter::Filters::ScopeFilter
- Includes:
- Errors
- Defined in:
- lib/filterameter/filters/scope_filter.rb
Overview
# Scope Filter
Class ScopeFilter applies the named scope passing in the parameter value.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Errors
Instance Method Summary collapse
- #apply(query, value) ⇒ Object
-
#initialize(scope_name) ⇒ ScopeFilter
constructor
A new instance of ScopeFilter.
Methods included from Errors
Constructor Details
#initialize(scope_name) ⇒ ScopeFilter
Returns a new instance of ScopeFilter.
11 12 13 |
# File 'lib/filterameter/filters/scope_filter.rb', line 11 def initialize(scope_name) @scope_name = scope_name end |
Instance Method Details
#apply(query, value) ⇒ Object
15 16 17 |
# File 'lib/filterameter/filters/scope_filter.rb', line 15 def apply(query, value) query.public_send(@scope_name, value) end |