Class: ActiveRecord::Refined::AST::Aggregate
- Defined in:
- lib/active_record/refined/ast.rb
Instance Attribute Summary collapse
-
#function ⇒ Object
readonly
Returns the value of attribute function.
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
Instance Method Summary collapse
-
#initialize(operand, function) ⇒ Aggregate
constructor
A new instance of Aggregate.
- #to_arel(table) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(operand, function) ⇒ Aggregate
Returns a new instance of Aggregate.
64 65 66 67 |
# File 'lib/active_record/refined/ast.rb', line 64 def initialize(operand, function) @operand = operand @function = function end |
Instance Attribute Details
#function ⇒ Object (readonly)
Returns the value of attribute function.
62 63 64 |
# File 'lib/active_record/refined/ast.rb', line 62 def function @function end |
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
62 63 64 |
# File 'lib/active_record/refined/ast.rb', line 62 def operand @operand end |
Instance Method Details
#to_arel(table) ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/active_record/refined/ast.rb', line 69 def to_arel(table) arel_operand = case operand when Node then operand.to_arel(table) else table[operand] end arel_operand.public_send(function) end |