Class: MR::ReadModel::StaticQueryExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/mr/read_model/query_expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



18
19
20
# File 'lib/mr/read_model/query_expression.rb', line 18

def args
  @args
end

#typeObject (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