Class: Sum

Inherits:
Column show all
Defined in:
lib/lilit_sql.rb

Instance Attribute Summary

Attributes inherited from Column

#name, #origin

Instance Method Summary collapse

Methods inherited from Column

#==, #state, #with_from

Methods inherited from Expr

#*, #+, #<, #<=, #>, #>=, #and, #asc, #desc, #eq, #in, #minus, #ne, #not, #plus

Constructor Details

#initialize(col) ⇒ Sum

Returns a new instance of Sum.



316
317
318
# File 'lib/lilit_sql.rb', line 316

def initialize(col)
  super(nil, col)
end

Instance Method Details

#decl_sqlObject



324
325
326
# File 'lib/lilit_sql.rb', line 324

def decl_sql
  "sum(#{@origin.ref_sql})"
end

#ref_sqlObject



320
321
322
# File 'lib/lilit_sql.rb', line 320

def ref_sql
  decl_sql
end