module

Money::Currency::Enumeration

Inherits Enumerable

Instance methods

[](key : String | Symbol) : Currency

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
Source
[]?(key : String | Symbol) : Currency | Nil

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
Source
each

Must yield this collection's elements to the block.

Source
find(key : String | Symbol) : Currency

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
Source
find?(key : String | Symbol) : Currency | Nil

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
Source