Module: Gera::CurrencyPairSupport
- Extended by:
- ActiveSupport::Concern
- Included in:
- CrossRateMode, CurrencyRate, CurrencyRateMode, ExternalRate
- Defined in:
- app/models/concerns/gera/currency_pair_support.rb
Instance Method Summary collapse
- #currency_from ⇒ Object
- #currency_pair ⇒ Object
- #currency_pair=(value) ⇒ Object
- #currency_to ⇒ Object
Instance Method Details
#currency_from ⇒ Object
34 35 36 |
# File 'app/models/concerns/gera/currency_pair_support.rb', line 34 def currency_from @currency_from ||= cur_from.is_a?(Money::Currency) ? cur_from : Money::Currency.find!(cur_from) end |
#currency_pair ⇒ Object
30 31 32 |
# File 'app/models/concerns/gera/currency_pair_support.rb', line 30 def currency_pair @currency_pair ||= Gera::CurrencyPair.new currency_from, currency_to end |
#currency_pair=(value) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/models/concerns/gera/currency_pair_support.rb', line 21 def currency_pair=(value) self.cur_from = value.cur_from self.cur_to = value.cur_to @currency_pair = nil @currency_from = nil @currency_to = nil value end |