Class: Plutonium::Query::ModelScope
- Defined in:
- lib/plutonium/query/model_scope.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #apply(scope) ⇒ Object
-
#initialize(name) ⇒ ModelScope
constructor
Initializes a ModelScope with a given name.
Methods included from Definition::Presentable
Constructor Details
#initialize(name) ⇒ ModelScope
Initializes a ModelScope with a given name.
9 10 11 12 |
# File 'lib/plutonium/query/model_scope.rb', line 9 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/plutonium/query/model_scope.rb', line 4 def name @name end |
Instance Method Details
#apply(scope) ⇒ Object
14 15 16 |
# File 'lib/plutonium/query/model_scope.rb', line 14 def apply(scope, **) scope.public_send(name, **) end |