Class: AggregateExpression
- Inherits:
-
Object
- Object
- AggregateExpression
- Defined in:
- lib/expressions/aggregate_expression.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build_arel(arel_table) ⇒ Object
-
#initialize(collection) ⇒ AggregateExpression
constructor
A new instance of AggregateExpression.
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 |