14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/twitter_cldr/shared/currencies.rb', line 14
def for_code(currency_code, locale = :en)
currency_code = currency_code.to_sym
data = resource(locale)[currency_code]
symbol_data = iso_currency_symbols[currency_code]
if data
result = {
currency: currency_code,
name: data[:name],
cldr_symbol: data[:symbol] || currency_code.to_s,
symbol: data[:symbol] || currency_code.to_s,
code_points: (data[:symbol] || currency_code.to_s).unpack("U*")
}
result.merge!(symbol_data) if symbol_data
end
result
end
|