Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/numeric.rb
Instance Method Summary collapse
-
#as(alias_name) ⇒ Object
call-seq: numeric.as(alias_name) -> a_symbol.
-
#to_sql ⇒ Object
call-seq: numeric.to_sql -> a_numeric.
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_sql ⇒ Object
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 |