Sha256: 71a4e39508dd72eec8c06e5066b2452f5919ad940551e8578aaec262b5308d02

Contents?: true

Size: 530 Bytes

Versions: 9

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

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

9 entries across 9 versions & 1 rubygems

Version Path
countries-7.1.1 lib/countries/country/currency_methods.rb
countries-7.1.0 lib/countries/country/currency_methods.rb
countries-7.0.0 lib/countries/country/currency_methods.rb
countries-6.0.0 lib/countries/country/currency_methods.rb
countries-5.7.2 lib/countries/country/currency_methods.rb
countries-5.7.1 lib/countries/country/currency_methods.rb
countries-5.7.0 lib/countries/country/currency_methods.rb
countries-5.6.0 lib/countries/country/currency_methods.rb
countries-5.5.0 lib/countries/country/currency_methods.rb