Class: MR::ReadModel::StaticQueryExpression
- Inherits:
-
Object
- Object
- MR::ReadModel::StaticQueryExpression
- Defined in:
- lib/mr/read_model/query_expression.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#apply_to(relation, params = nil) ⇒ Object
‘apply_to` has to take params that it ignores, so it has the same interface as `DynamicQueryExpression` (which actually uses the params).
-
#initialize(type, *args) ⇒ StaticQueryExpression
constructor
A new instance of StaticQueryExpression.
Constructor Details
#initialize(type, *args) ⇒ StaticQueryExpression
Returns a new instance of StaticQueryExpression.
20 21 22 23 |
# File 'lib/mr/read_model/query_expression.rb', line 20 def initialize(type, *args) @type = type @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
18 19 20 |
# File 'lib/mr/read_model/query_expression.rb', line 18 def args @args end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
18 19 20 |
# File 'lib/mr/read_model/query_expression.rb', line 18 def type @type end |
Instance Method Details
#apply_to(relation, params = nil) ⇒ Object
‘apply_to` has to take params that it ignores, so it has the same interface as `DynamicQueryExpression` (which actually uses the params)
27 28 29 |
# File 'lib/mr/read_model/query_expression.rb', line 27 def apply_to(relation, params = nil) relation.send(@type, *@args) end |