Sha256: 6e65637c4df260214c6e8893e1dd9397ca67c29f693c2a3d7653cfb7daea8310

Contents?: true

Size: 531 Bytes

Versions: 12

Compression:

Stored size: 531 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

12 entries across 12 versions & 1 rubygems

Version Path
countries-5.4.0 lib/countries/country/currency_methods.rb
countries-5.3.2 lib/countries/country/currency_methods.rb
countries-5.3.1 lib/countries/country/currency_methods.rb
countries-5.3.0 lib/countries/country/currency_methods.rb
countries-5.2.1 lib/countries/country/currency_methods.rb
countries-5.2.0 lib/countries/country/currency_methods.rb
countries-5.1.2 lib/countries/country/currency_methods.rb
countries-5.1.1 lib/countries/country/currency_methods.rb
countries-5.1.0 lib/countries/country/currency_methods.rb
countries-5.0.2 lib/countries/country/currency_methods.rb
countries-5.0.1 lib/countries/country/currency_methods.rb
countries-5.0.0 lib/countries/country/currency_methods.rb