Class: Repor::Aggregators::AvgAggregator

Inherits:
BaseAggregator show all
Defined in:
lib/repor/aggregators/avg_aggregator.rb

Instance Attribute Summary

Attributes inherited from BaseAggregator

#name, #opts, #report

Instance Method Summary collapse

Methods inherited from BaseAggregator

#aggregate, #initialize

Constructor Details

This class inherits a constructor from Repor::Aggregators::BaseAggregator

Instance Method Details

#aggregation(groups) ⇒ Object



4
5
6
# File 'lib/repor/aggregators/avg_aggregator.rb', line 4

def aggregation(groups)
  groups.select("AVG(#{expression}) AS #{sql_value_name}")
end