Class: ActiveRecordCalculator::GroupOperation

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record_calculator/group_operation.rb

Instance Method Summary collapse

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_selectObject



9
10
11
# File 'lib/active_record_calculator/group_operation.rb', line 9

def build_select
  "#{@column} AS #{@as}"
end

#inspectObject



13
14
15
# File 'lib/active_record_calculator/group_operation.rb', line 13

def inspect
  @column.to_s
end

#nameObject



17
18
19
# File 'lib/active_record_calculator/group_operation.rb', line 17

def name
  @as.to_s
end