Class: Numeric

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

Instance Method Summary collapse

Instance Method Details

#as(alias_name) ⇒ Object

call-seq: numeric.as(alias_name) -> a_symbol

Returns the number aliased (including ‘as’) as the aliased name

10.as(:column1)     #=> :"10 as column"


16
17
18
# File 'lib/numeric.rb', line 16

def as(alias_name)
  "#{self} as #{alias_name}".to_sym
end

#to_sqlObject

call-seq: numeric.to_sql -> a_numeric

Returns self

10.to_sql     #=> 10


7
8
9
# File 'lib/numeric.rb', line 7

def to_sql
  self
end