Class: Pragma::Filter::Scope
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Attributes inherited from Base
Instance Method Summary collapse
- #apply(relation:, value:) ⇒ Object
-
#initialize(scope:, **other) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(scope:, **other) ⇒ Scope
Returns a new instance of Scope.
8 9 10 11 |
# File 'lib/pragma/filter/scope.rb', line 8 def initialize(scope:, **other) super(**other) @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
6 7 8 |
# File 'lib/pragma/filter/scope.rb', line 6 def scope @scope end |
Instance Method Details
#apply(relation:, value:) ⇒ Object
13 14 15 |
# File 'lib/pragma/filter/scope.rb', line 13 def apply(relation:, value:) relation.public_send(scope, value) end |