Class: ActiveRecord::Refined::AST::Aggregate

Inherits:
Node
  • Object
show all
Includes:
Predications
Defined in:
lib/active_record/refined/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Predications

#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #end_with?, #in?, #include?, #like?, #null?, #start_with?

Methods inherited from Node

#as, #asc, #desc

Constructor Details

#initialize(operand, function) ⇒ Aggregate

Returns a new instance of Aggregate.



137
138
139
140
# File 'lib/active_record/refined/ast.rb', line 137

def initialize(operand, function)
  @operand = operand
  @function = function
end

Instance Attribute Details

#functionObject (readonly)

Returns the value of attribute function.



135
136
137
# File 'lib/active_record/refined/ast.rb', line 135

def function
  @function
end

#operandObject (readonly)

Returns the value of attribute operand.



135
136
137
# File 'lib/active_record/refined/ast.rb', line 135

def operand
  @operand
end

Instance Method Details

#to_arel(table) ⇒ Object



142
143
144
# File 'lib/active_record/refined/ast.rb', line 142

def to_arel(table)
  to_arel_operand(operand, table).public_send(function)
end