Class: ActiveRecordCalculator::GroupOperation
- Inherits:
-
Object
- Object
- ActiveRecordCalculator::GroupOperation
- Defined in:
- lib/active_record_calculator/group_operation.rb
Instance Method Summary collapse
- #build_select ⇒ Object
-
#initialize(column, as) ⇒ GroupOperation
constructor
A new instance of GroupOperation.
- #inspect ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(column, as) ⇒ GroupOperation
Returns a new instance of GroupOperation.
4 5 6 7 |
# File 'lib/active_record_calculator/group_operation.rb', line 4 def initialize(column, as) @column = column @as = as end |
Instance Method Details
#build_select ⇒ Object
9 10 11 |
# File 'lib/active_record_calculator/group_operation.rb', line 9 def build_select "#{@column} AS #{@as}" end |
#inspect ⇒ Object
13 14 15 |
# File 'lib/active_record_calculator/group_operation.rb', line 13 def inspect @column.to_s end |
#name ⇒ Object
17 18 19 |
# File 'lib/active_record_calculator/group_operation.rb', line 17 def name @as.to_s end |