module
Money::Currency::Enumeration
Included Modules
- Enumerable(Money::Currency)
Defined in:
money/currency/enumeration.crInstance Method Summary
-
#[](key : String | Symbol) : Currency
Alias of
#find
. -
#[]?(key : String | Symbol) : Currency | Nil
Alias of
#find?
. -
#all : Array(Currency)
Returns a sorted list of all registered currencies.
-
#each(& : Currency -> _) : Nil
Iterates over all registered currencies.
-
#find(key : String | Symbol) : Currency
Lookup a currency with given key an returns a
Currency
instance on success, raisesUnknownCurrencyError
otherwise. -
#find?(key : String | Symbol) : Currency | Nil
Lookup a currency with given key an returns a
Currency
instance on success,nil
otherwise.
Instance Method Detail
Lookup a currency with given key an returns a Currency
instance on
success, raises UnknownCurrencyError
otherwise.
Money::Currency.find("EUR") # => #<Money::Currency @id="eur">
Money::Currency.find("FOO") # => raises UnknownCurrencyError
Lookup a currency with given key an returns a Currency
instance on
success, nil
otherwise.
Money::Currency.find("EUR") # => #<Money::Currency @id="eur">
Money::Currency.find("FOO") # => nil