Class: Money::LocaleBackend::Legacy

Inherits:
Base
  • Object
show all
Defined in:
lib/money/locale_backend/legacy.rb

Instance Method Summary collapse

Constructor Details

#initializeLegacy

Returns a new instance of Legacy.

Raises:


7
8
9
# File 'lib/money/locale_backend/legacy.rb', line 7

def initialize
  raise NotSupported, 'I18n not found' if Money.use_i18n && !defined?(::I18n)
end

Instance Method Details

#lookup(key, currency) ⇒ Object


11
12
13
14
15
16
17
18
19
# File 'lib/money/locale_backend/legacy.rb', line 11

def lookup(key, currency)
  warn '[DEPRECATION] You are using the default localization behaviour that will change in the next major release. Find out more - https://github.com/RubyMoney/money#deprecation'

  if Money.use_i18n
    i18n_backend.lookup(key, nil) || currency.public_send(key)
  else
    currency.public_send(key)
  end
end