Sha256: af3af4c579806d369502a169f36b5aa4cde39627f25977787f3e4266d088f8a2

Contents?: true

Size: 682 Bytes

Versions: 3

Compression:

Stored size: 682 Bytes

Contents

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

TwitterCldr.Currencies = class Currencies
  @currencies = `{{{currencies}}}`

  @countries: ->
    @names ||= (country_name for country_name, data of @currencies)

  @currency_codes: ->
    @codes ||= (data.code for country_name, data of @currencies)

  @for_country: (country_name) ->
    @currencies[country_name]

  @for_code: (currency_code) ->
    final = null
    for country_name, data of @currencies
      if data.code == currency_code
        final =
          country: country_name
          code: data.code
          symbol: data.symbol
          currency: data.currency
        break

    final

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
twitter_cldr_js-1.0.0 lib/twitter_cldr/js/mustache/shared/currencies.coffee
twitter_cldr-1.8.0 js/lib/mustache/shared/currencies.coffee
twitter_cldr-1.7.0 js/lib/mustache/shared/currencies.coffee