Object
Open Numeric to add new method.
Converts this numeric into a Money object in the given currency.
@param [Currency, String, Symbol] currency
The currency to set the resulting +Money+ object to.
@return [Money]
@example
100.to_money #=> #<Money @cents=10000> 100.37.to_money #=> #<Money @cents=10037> BigDecimal.new('100').to_money #=> #<Money @cents=10000>
@see Money.from_numeric
# File lib/money/core_extensions.rb, line 18 def to_money(currency = nil) Money.from_numeric(self, currency || Money.default_currency) end
Generated with the Darkfish Rdoc Generator 2.