Class: Money
- Inherits:
-
Object
- Object
- Money
- Defined in:
- lib/money/bank/historical.rb,
lib/money/rates_store/historical_redis.rb,
lib/money/rates_provider/open_exchange_rates.rb
Defined Under Namespace
Modules: Bank, RatesProvider, RatesStore
Instance Method Summary collapse
-
#exchange_to_historical(other_currency, datetime, &rounding_method) ⇒ Object
Exchanges to
other_currencyusingdatetime‘s closing rates and returns a newMoneyobject.
Instance Method Details
#exchange_to_historical(other_currency, datetime, &rounding_method) ⇒ Object
Exchanges to other_currency using datetime‘s closing rates and returns a new Money object. rounding_method is ignored in this version of the gem.
Parameters
-
other_currency- The currency to exchange to. Accepts ISO String andMoney::Currencyobjects. -
datetime- TheDateto get the exchange rate from. IfTimeis passed instead, it’s converted to the UTCDate. -
rounding_method- This parameter is ignored in this version of the gem.
342 343 344 345 |
# File 'lib/money/bank/historical.rb', line 342 def exchange_to_historical(other_currency, datetime, &rounding_method) Bank::Historical.instance.exchange_with_historical(self, other_currency, datetime, &rounding_method) end |