Class: AggregateExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/expressions/aggregate_expression.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ AggregateExpression

Returns a new instance of AggregateExpression.



7
8
9
# File 'lib/expressions/aggregate_expression.rb', line 7

def initialize(collection)
  @collection = collection.map { |each| PredicateLiteral.parse(each) }
end

Class Method Details

.parse(array) ⇒ Object



3
4
5
# File 'lib/expressions/aggregate_expression.rb', line 3

def self.parse(array)
  self.new(array[1..-1])
end

Instance Method Details

#build_arel(arel_table) ⇒ Object



11
12
13
# File 'lib/expressions/aggregate_expression.rb', line 11

def build_arel(arel_table)
  @collection.map { |each| each.build_arel(arel_table) }
end