Sha256: e72bf2f451d7d23c22284460defae314e00e84f8bea70fcb06163353ad5f23c2

Contents?: true

Size: 500 Bytes

Versions: 3

Compression:

Stored size: 500 Bytes

Contents

require 'money'

module ISO3166
  # Optional extension which allows you to get back a +Money::Currency+ object with all the currency info.
  # This requires enabling the integration with the {Money}[https://github.com/RubyMoney/money] gem (See {ISO3166::Configuration#enable_currency_extension!})
  module CountryCurrencyMethods

    # @return [Money::Currency] The currency data for this Country's +currency_code+
    def currency
      Money::Currency.find(data['currency_code'])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
countries-4.2.3 lib/countries/country/currency_methods.rb
countries-4.2.2 lib/countries/country/currency_methods.rb
countries-4.2.1 lib/countries/country/currency_methods.rb