Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/core_ext/numeric.rb
Overview
opening the numberic standard class to add 2 methods
Instance Method Summary collapse
-
#to_amount ⇒ Object
divide by 100.
-
#to_cents ⇒ Object
multiply by 100.
Instance Method Details
#to_amount ⇒ Object
divide by 100
9 10 11 |
# File 'lib/core_ext/numeric.rb', line 9 def to_amount self / 100 end |
#to_cents ⇒ Object
multiply by 100
4 5 6 |
# File 'lib/core_ext/numeric.rb', line 4 def to_cents self * 100 end |