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 : Currency) : Currency
Returns given
Currencyinstance. -
#[]?(key : String | Symbol) : Currency | Nil
Alias of
#find?. -
#[]?(key : Currency) : Currency | Nil
Returns given
Currencyinstance. -
#all : Array(Currency)
Returns a sorted list of all registered currencies.
-
#each(& : Currency -> ) : Nil
Iterates over all registered currencies.
-
#find(key : String | Symbol) : Currency
Looks up a currency with the given key and returns a
Currencyinstance on success, raisesNotFoundErrorotherwise. -
#find?(key : String | Symbol) : Currency | Nil
Looks up a currency with the given key and returns a
Currencyinstance on success,nilotherwise.
Instance Method Detail
Looks up a currency with the given key and returns a Currency instance
on success, raises NotFoundError otherwise.
Money::Currency.find("EUR") # => #<Money::Currency @code="EUR">
Money::Currency.find("FOO") # raises Money::Currency::NotFoundError
Looks up a currency with the given key and returns a Currency instance
on success, nil otherwise.
Money::Currency.find?("EUR") # => #<Money::Currency @code="EUR">
Money::Currency.find?("FOO") # => nil