Skip to content
This repository
Browse code

Add in all countries and correct currency data.

  • Loading branch information...
commit 8561e7643419763b6d4fedd4e696c7d08d600f50 1 parent 54741cd
aimee daniells and Tom Brand authored committed
276 lib/iso4217/currencies.rb
@@ -5,122 +5,166 @@ module ISO4217
5 5 POUND_SIGN= "U+00a3"
6 6
7 7 CURRENCIES = [
8   - ALBANIAN_LEK= Currency.new(:ALL, "Lek", 'Lek'),
9   - AMERICAN_DOLLAR= Currency.new(:USD, DOLLAR_SIGN, 'US dollar'),
10   - AFGHANI= Currency.new(:AFN, "U+060b", 'Afghani'),
11   - ALGERIAN_DINAR= Currency.new(:DZD, "DA", 'Algerian dinar'),
12   - ANGOLAN_KWANZA= Currency.new(:AOA, "Kz", 'Angolan kwanza'),
13   - ARGENTINA_PESOS= Currency.new(:ARS, "U+0024", 'Argentine peso'),
14   - ARMENIAN_DRAM= Currency.new(:AMD, "U+0534", 'Armenian dram'),
15   - ARUBAN_FLORIN= Currency.new(:AWG, "Afl", 'Aruban florin'),
16   - AUSTRALIAN_DOLLAR= Currency.new(:AUD, DOLLAR_SIGN, 'Australian dollar'),
17   - AZERBAIJANIAN_MANAT= Currency.new(:AZN, "man", 'Azerbaijani manat'),
18   - BAHAMAS_DOLLAR= Currency.new(:BSD, DOLLAR_SIGN, 'Bahamian dollar'),
19   - BAHRAINI_DINAR= Currency.new(:BHD, "BD", 'Bahraini dinar'),
20   - BANGLADESHI_TAKA= Currency.new(:BDT, "U+09F3", 'Bangladeshi taka'),
21   - BARBADOS_DOLLAR= Currency.new(:BBD, DOLLAR_SIGN, 'Barbados dollar'),
22   - BELARUS_RUBLE= Currency.new(:BYR, "U+0070U+002e", 'Belarusian ruble'),
23   - BELIZE_DOLLAR= Currency.new(:BZD, "U+0042U+005aU+0024", 'Belize dollar'),
24   - BERMUDA_DOLLARS= Currency.new(:BMD, DOLLAR_SIGN, 'Bermudian dollar'),
25   - BOLIVIA_BOLIVIANOS= Currency.new(:BOB, "#{DOLLAR_SIGN}U+0062", 'Boliviano'),
26   - CONVERTIBLE_MARKA= Currency.new(:BAM, "U+004bU+004d", 'Convertible marka'),
27   - BOTSWANA_PULAS= Currency.new(:BWP, "U+0050", 'Pula'),
28   - BULGARIAN_LEVA= Currency.new(:BGN, "U+043bU+0432", 'Bulgarian lev'),
29   - BRAZILIAN_REAL= Currency.new(:BRL, "U+0052#{DOLLAR_SIGN}", 'Brazilian real'),
30   - BRITAIN_POUND= Currency.new(:GBP, "U+00a3", 'Pound sterling'),
31   - BRUNEI_DARUSSALAM_DOLLAR= Currency.new(:BND, DOLLAR_SIGN, 'Brunei dollar'),
32   - CAMBODIAN_RIELS= Currency.new(:KHR, "U+17db", 'Riel'),
33   - CANADIAN_DOLLAR= Currency.new(:CAD, "CanU+0024", 'Canadian dollar'),
34   - CAYMAN_ISLANDS_DOLLARS= Currency.new(:KYD, DOLLAR_SIGN, 'Cayman Islands dollar'),
35   - CHILE_PESOS= Currency.new(:CLP, DOLLAR_SIGN, 'Chilean peso'),
36   - CHINA_YUAN_RENMINBI= Currency.new(:CNY, "U+00a5", 'Chinese Yuan'),
37   - COLOMBIAN_PESO= Currency.new(:COP, DOLLAR_SIGN, 'Colombian peso'),
38   - COSTA_RICA_COLON= Currency.new(:CRC, "U+20a1", 'Costa Rica colon'),
39   - CROATIAN_KUNA= Currency.new(:HRK, "U+006bU+006e", 'Croatian kuna'),
40   - CUBA_PESOS= Currency.new(:CUP, "U+20b1", 'Cuban peso'),
41   - CZECH_KORUNA= Currency.new(:CZK, "U+004bU+010d", 'Czech Koruna'),
42   - DENMARK_KRONER= Currency.new(:DKK, "U+006bU+0072", 'Danish krone'),
43   - DOMINICAN_REPUBLIC_PESOS= Currency.new(:DOP, "U+0052U+0044U+0024", 'Dominican peso'),
44   - EAST_CARIBBEAN_DOLLAR= Currency.new(:XCD, DOLLAR_SIGN, 'East Caribbean dollar'),
45   - EGYPT_POUND= Currency.new(:EGP, POUND_SIGN, 'Egyptian pound'),
46   - EL_SALVADOR_COLON= Currency.new(:SVC, DOLLAR_SIGN, 'Salvadoran colón'),
47   - ESTONIAN_KROONI= Currency.new(:EEK, "U+006bU+0072", 'Kroon'),
48   - EURO= Currency.new(:EUR, "U+20ac", 'euro'),
49   - FALKLAND_ISLANDS_POUND= Currency.new(:FKP, POUND_SIGN, 'Falkland Islands pound'),
50   - FIJI_DOLLAR= Currency.new(:FJD, DOLLAR_SIGN, 'Fiji dollar'),
51   - GHANA_CEDI= Currency.new(:GHC, "U+00a2", 'Ghanian cedi'),
52   - GIBRLATAR_POUND= Currency.new(:GIP, POUND_SIGN, 'Gibraltar pound'),
53   - GUATEMALA_QUEZALES= Currency.new(:GTQ, "U+0051", 'Quezal'),
54   - GUERNSEY_POUND= Currency.new(:GGP, POUND_SIGN, 'Guernsey pound'),
55   - GUYANA_DOLLAR= Currency.new(:GYD, DOLLAR_SIGN, 'Guyana dollar'),
56   - HONDURAS_LEMPIRAS= Currency.new(:HNL, "U+004c", 'Lempira'),
57   - HONG_KONG_DOLLAR= Currency.new(:HKD, DOLLAR_SIGN, 'Hong Kong dollar'),
58   - HUNGARY_FORINT= Currency.new(:HUF, "U+0046U+0074", 'Forint'),
59   - ICELAND_KRONUR= Currency.new(:ISK, "U+006bU+0072", 'Iceland krona'),
60   - INDIAN_RUPEE= Currency.new(:INR, "U+20a8", 'Indian rupee'),
61   - INDONESIAN_RUPIAH= Currency.new(:IDR, "U+0082U+0112", 'Rupiah'),
62   - IRAN_RIALS= Currency.new(:IRR, "U+fdfc", 'Iranian rial'),
63   - ISLE_OF_MAN_POUND= Currency.new(:IMP, POUND_SIGN, 'Pound'),
64   - ISRAEL_NEW_SHEKEL= Currency.new(:ILS, "U+20aa", 'Israeli new sheqel'),
65   - JAMAICA_DOLLAR= Currency.new(:JMD, "U+004a#{DOLLAR_SIGN}", 'Jamaican dollar'),
66   - JAPAN_YEN= Currency.new(:JPY, "U+00a5", 'Japanese yen'),
67   - JERSEY_POUND= Currency.new(:JEP, POUND_SIGN, 'Jersey pound'),
68   - KAZAKHSTAN_TENGE= Currency.new(:KZT, "U+043bU+432", 'Tenge'),
69   - NORTH_KOREAN_WON= Currency.new(:KPW, "U+20a9", 'North Korean won'),
70   - SOUTH_KOREAN_WON= Currency.new(:KRW, "U+20a9", 'South Korean won'),
71   - KYRGYZSTAN_SOMS= Currency.new(:KGS, "U+043bU+0432", 'Som'),
72   - LAOS_KIPS= Currency.new(:LAK, "U+20ad", 'Kip'),
73   - LATVIAN_LATI= Currency.new(:LVL, "U+004cU+0073", 'Latvian lats'),
74   - LEBANON_POUND= Currency.new(:LBP, POUND_SIGN, 'Lebanese pound'),
75   - LIBERIA_DOLLARS= Currency.new(:LRD, DOLLAR_SIGN, 'Liberian dollar'),
76   - SWITZERLAND_FRANCS= Currency.new(:CHF, "U+0043U+0048U+0046", 'Swiss franc'),
77   - LITHUANIA_LITAI= Currency.new(:LTL, "U+004cU+0074", 'Lithuanian litas'),
78   - MACEDONIA_DENARS= Currency.new(:MKD, "U+0434U+0435U+043d", 'Denar'),
79   - MALAYSIA_RINGGITS= Currency.new(:MYR, "U+0052U+004d", 'Malaysian ringgit'),
80   - MAURITIUS_RUPEES= Currency.new(:MUR, "U+20a8", 'Mauritius rupee'),
81   - MEXICO_PESOS= Currency.new(:MXN, DOLLAR_SIGN, 'Mexican peso'),
82   - MONGOLIA_TUGRIKS= Currency.new(:MNT, "U+20ae", 'Tugrik'),
83   - MOZAMBIQUE_METICALS= Currency.new(:MZN, "U+004dU+0054", 'Metical'),
84   - NAMIBIA_DOLLARS= Currency.new(:NAD, DOLLAR_SIGN, 'Namibian dollar'),
85   - NEPAL_RUPEES= Currency.new(:NPR, "U+20a8", 'Nepalese rupee'),
86   - NETHERLANDS_ANTILLES_GUILDERS= Currency.new(:ANG, "U+0192", 'Netherlands Antillean gulider'),
87   - NEW_ZEALAND_DOLLARS= Currency.new(:NZD, DOLLAR_SIGN, 'New Zealand dollar'),
88   - NICARAGUA_CORDOBAS= Currency.new(:NIO, "U+0043#{DOLLAR_SIGN}", 'Cordoba oro'),
89   - NIGERIA_NAIRAS= Currency.new(:NGN, "U+20a6", 'Naira'),
90   - NORWAY_KRONE= Currency.new(:NOK, "U+006bU+0072", 'Norwegian krone'),
91   - OMAN_RIALS= Currency.new(:OMR, "U+fdfc", 'Rial Omani'),
92   - PAKISTAN_RUPEES= Currency.new(:PKR, "U+20a8", 'Pakistan rupee'),
93   - PANAMA_BALBOA= Currency.new(:PAB, "U+0042U+002fU+002e", 'Balboa'),
94   - PARAGUAY_GUARANI= Currency.new(:PYG, "U+0047U+0073", 'Guarani'),
95   - PERU_NUEVOS_SOLES= Currency.new(:PEN, "U+0053U+002fU+002e", 'Nuevo sol'),
96   - PHILIPPINES_PESOS= Currency.new(:PHP, "U+0050U+0068U+0070", 'Philippine peso'),
97   - POLAND_ZLOTYCH= Currency.new(:PLN, "U+007aU+0142", 'Zloty'),
98   - QATAR_RIALS= Currency.new(:QAR, "U+fdfc", 'Qatari rial'),
99   - ROMANIA_NEW_LEI= Currency.new(:RON, "U+006cU+0065U+0069", 'Romanian new leu'),
100   - RUSSIA_RUBLES= Currency.new(:RUB, "U+0440U+0443U+0432", 'Russian rouble'),
101   - SAINT_HELENA_POUNDS= Currency.new(:SHP, POUND_SIGN, 'Saint Helena pound'),
102   - SAUDI_ARABIA_RIYALS= Currency.new(:SAR, "U+fdfc", 'Saudi riyal'),
103   - SERBIA_DINARS= Currency.new(:RSD, "U+0414U+0438U+043dU+002e", 'Serbian dinar'),
104   - SEYCHELIES_RUPEES= Currency.new(:SCR, "U+20a8", 'Seychelles rupee'),
105   - SINGAPORE_DOLLARS= Currency.new(:SGD, DOLLAR_SIGN, 'Singapore dollar'),
106   - SOLOMON_ISLANDS_DOLLARS= Currency.new(:SBD, DOLLAR_SIGN, 'Solomon Islands dollar'),
107   - SOMALIA_SHILLINGS= Currency.new(:SOS, "U+0053", 'Somali shilling'),
108   - SOUTH_AFRICA_RAND= Currency.new(:ZAR, "U+0052", 'South African rand'),
109   - SRI_LANKA_RUPEES= Currency.new(:LKR, "U+20a8", 'Sri Lanka rupee'),
110   - SWEDEN_KRONOR= Currency.new(:SEK, "U+006bU+0072", 'Swedish krona/kronor'),
111   - SURINAME_DOLLARS= Currency.new(:SRD, DOLLAR_SIGN, 'Surinam dollar'),
112   - SYRIA_POUNDS= Currency.new(:SYP, POUND_SIGN, 'Syrian pound'),
113   - TAIWAN_NEW_DOLLARS= Currency.new(:TWD, "U+004eU+0054U+0024", 'New Taiwan dollar'),
114   - THAILAND_BAHT= Currency.new(:THB, "U+0e3f", 'Baht'),
115   - TRINIDAD_AND_TOBAGO_DOLLARS= Currency.new(:TTD, "U+0054U+0054#{DOLLAR_SIGN}", 'Trinidad and Tobago dollar') ,
116   - TURKEY_LIRA= Currency.new(:TRY, "U+0054U+004c", 'Turkish lira'),
117   - TUVALU_DOLLARS= Currency.new(:TVD, DOLLAR_SIGN, 'Tuvalu dollar'),
118   - UKRAINE_HRYVNIA= Currency.new(:UAH, "U+20b4", 'Hryvina'),
119   - URUGUAY_PESOS= Currency.new(:UYU, "#{DOLLAR_SIGN}U+0055", 'Peso Uruguayo'),
120   - UZBEKISTAN_SUMS= Currency.new(:UZS, "U+043bU+0432", 'Uzbekistan som'),
121   - VENEZUELA_BOLIVARES_FUERTES= Currency.new(:VEF, "U+0042U+0073", 'Venezuelan bolivar fuerte'),
122   - VIETNAM_DONG= Currency.new(:VND, "U+20ab", 'Vietnamese dong'),
123   - YEMEN_RIALS= Currency.new(:YER, "U+fdfc", 'Yemeni rial')
  8 + UNITED_ARAB_EMIRATES_DIRHAM = Currency.new(:AED, 'د.إ', 'United Arab Emirates Dirham'),
  9 + AFGHAN_AFGHANI = Currency.new(:AFN, '؋', 'Afghan Afghani'),
  10 + ALBANIAN_LEK = Currency.new(:ALL, 'L', 'Albanian Lek'),
  11 + ARMENIAN_DRAM = Currency.new(:AMD, 'դր.', 'Armenian Dram'),
  12 + NETHERLANDS_ANTILLEAN_GULDEN = Currency.new(:ANG, 'ƒ', 'Netherlands Antillean Gulden'),
  13 + ANGOLAN_KWANZA = Currency.new(:AOA, 'Kz', 'Angolan Kwanza'),
  14 + ARGENTINE_PESO = Currency.new(:ARS, '$', 'Argentine Peso'),
  15 + AUSTRALIAN_DOLLAR = Currency.new(:AUD, '$', 'Australian Dollar'),
  16 + ARUBAN_FLORIN = Currency.new(:AWG, 'ƒ', 'Aruban Florin'),
  17 + AZERBAIJANI_MANAT = Currency.new(:AZN, 'man', 'Azerbaijani Manat'),
  18 + BOSNIA_AND_HERZEGOVINA_CONVERTIBLE_MARK = Currency.new(:BAM, 'KM', 'Bosnia and Herzegovina Convertible Mark'),
  19 + BARBADIAN_DOLLAR = Currency.new(:BBD, '$', 'Barbadian Dollar'),
  20 + BANGLADESHI_TAKA = Currency.new(:BDT, '৳', 'Bangladeshi Taka'),
  21 + BULGARIAN_LEV = Currency.new(:BGN, 'лв', 'Bulgarian Lev'),
  22 + BAHRAINI_DINAR = Currency.new(:BHD, 'ب.د', 'Bahraini Dinar'),
  23 + BURUNDIAN_FRANC = Currency.new(:BIF, 'Fr', 'Burundian Franc'),
  24 + BERMUDIAN_DOLLAR = Currency.new(:BMD, '$', 'Bermudian Dollar'),
  25 + BRUNEI_DOLLAR = Currency.new(:BND, '$', 'Brunei Dollar'),
  26 + BOLIVIAN_BOLIVIANO = Currency.new(:BOB, 'Bs.', 'Bolivian Boliviano'),
  27 + BRAZILIAN_REAL = Currency.new(:BRL, 'R$ ', 'Brazilian Real'),
  28 + BAHAMIAN_DOLLAR = Currency.new(:BSD, '$', 'Bahamian Dollar'),
  29 + BHUTANESE_NGULTRUM = Currency.new(:BTN, 'Nu', 'Bhutanese Ngultrum'),
  30 + BOTSWANA_PULA = Currency.new(:BWP, 'P', 'Botswana Pula'),
  31 + BELARUSIAN_RUBLE = Currency.new(:BYR, 'Br', 'Belarusian Ruble'),
  32 + BELIZE_DOLLAR = Currency.new(:BZD, '$', 'Belize Dollar'),
  33 + CANADIAN_DOLLAR = Currency.new(:CAD, 'Can$', 'Canadian Dollar'),
  34 + CONGOLESE_FRANC = Currency.new(:CDF, 'Fr', 'Congolese Franc'),
  35 + SWISS_FRANC = Currency.new(:CHF, 'Fr', 'Swiss Franc'),
  36 + CHILEAN_PESO = Currency.new(:CLP, '$', 'Chilean Peso'),
  37 + CHINESE_RENMINBI_YUAN = Currency.new(:CNY, '¥', 'Chinese Renminbi Yuan'),
  38 + COLOMBIAN_PESO = Currency.new(:COP, '$', 'Colombian Peso'),
  39 + COSTA_RICAN_COLON = Currency.new(:CRC, '₡', 'Costa Rican Colón'),
  40 + CUBAN_CONVERTIBLE_PESO = Currency.new(:CUC, '$', 'Cuban Convertible Peso'),
  41 + CUBAN_PESO = Currency.new(:CUP, '$', 'Cuban Peso'),
  42 + CAPE_VERDEAN_ESCUDO = Currency.new(:CVE, 'Esc', 'Cape Verdean Escudo'),
  43 + CZECH_KORUNA = Currency.new(:CZK, 'Kč', 'Czech Koruna'),
  44 + DJIBOUTIAN_FRANC = Currency.new(:DJF, 'Fr', 'Djiboutian Franc'),
  45 + DANISH_KRONE = Currency.new(:DKK, 'kr', 'Danish Krone'),
  46 + DOMINICAN_PESO = Currency.new(:DOP, '$', 'Dominican Peso'),
  47 + ALGERIAN_DINAR = Currency.new(:DZD, 'د.ج', 'Algerian Dinar'),
  48 + ESTONIAN_KROON = Currency.new(:EEK, 'KR', 'Estonian Kroon'),
  49 + EGYPTIAN_POUND = Currency.new(:EGP, 'ج.م', 'Egyptian Pound'),
  50 + ERITREAN_NAKFA = Currency.new(:ERN, 'Nfk', 'Eritrean Nakfa'),
  51 + ETHIOPIAN_BIRR = Currency.new(:ETB, 'Br', 'Ethiopian Birr'),
  52 + EURO = Currency.new(:EUR, '€', 'Euro'),
  53 + FIJIAN_DOLLAR = Currency.new(:FJD, '$', 'Fijian Dollar'),
  54 + FALKLAND_POUND = Currency.new(:FKP, '£', 'Falkland Pound'),
  55 + BRITISH_POUND = Currency.new(:GBP, '£', 'Pound Sterling'),
  56 + GEORGIAN_LARI = Currency.new(:GEL, 'ლ', 'Georgian Lari'),
  57 + GHANAIAN_CEDI = Currency.new(:GHS, '₵', 'Ghanaian Cedi'),
  58 + GIBRALTAR_POUND = Currency.new(:GIP, '£', 'Gibraltar Pound'),
  59 + GAMBIAN_DALASI = Currency.new(:GMD, 'D', 'Gambian Dalasi'),
  60 + GUINEAN_FRANC = Currency.new(:GNF, 'Fr', 'Guinean Franc'),
  61 + GUATEMALAN_QUETZAL = Currency.new(:GTQ, 'Q', 'Guatemalan Quetzal'),
  62 + GUYANESE_DOLLAR = Currency.new(:GYD, '$', 'Guyanese Dollar'),
  63 + HONG_KONG_DOLLAR = Currency.new(:HKD, '$', 'Hong Kong Dollar'),
  64 + HONDURAN_LEMPIRA = Currency.new(:HNL, 'L', 'Honduran Lempira'),
  65 + CROATIAN_KUNA = Currency.new(:HRK, 'kn', 'Croatian Kuna'),
  66 + HAITIAN_GOURDE = Currency.new(:HTG, 'G', 'Haitian Gourde'),
  67 + HUNGARIAN_FORINT = Currency.new(:HUF, 'Ft', 'Hungarian Forint'),
  68 + INDONESIAN_RUPIAH = Currency.new(:IDR, 'Rp', 'Indonesian Rupiah'),
  69 + ISRAELI_NEW_SHEQEL = Currency.new(:ILS, '₪', 'Israeli New Sheqel'),
  70 + INDIAN_RUPEE = Currency.new(:INR, '₨', 'Indian Rupee'),
  71 + IRAQI_DINAR = Currency.new(:IQD, 'ع.د', 'Iraqi Dinar'),
  72 + IRANIAN_RIAL = Currency.new(:IRR, '﷼', 'Iranian Rial'),
  73 + ICELANDIC_KRONA = Currency.new(:ISK, 'kr', 'Icelandic Króna'),
  74 + JAMAICAN_DOLLAR = Currency.new(:JMD, '$', 'Jamaican Dollar'),
  75 + JORDANIAN_DINAR = Currency.new(:JOD, 'د.ا', 'Jordanian Dinar'),
  76 + JAPANESE_YEN = Currency.new(:JPY, '¥', 'Japanese Yen'),
  77 + KENYAN_SHILLING = Currency.new(:KES, 'Sh', 'Kenyan Shilling'),
  78 + KYRGYZSTANI_SOM = Currency.new(:KGS, '', 'Kyrgyzstani Som'),
  79 + CAMBODIAN_RIEL = Currency.new(:KHR, '៛', 'Cambodian Riel'),
  80 + COMORIAN_FRANC = Currency.new(:KMF, 'Fr', 'Comorian Franc'),
  81 + NORTH_KOREAN_WON = Currency.new(:KPW, '₩', 'North Korean Won'),
  82 + SOUTH_KOREAN_WON = Currency.new(:KRW, '₩', 'South Korean Won'),
  83 + KUWAITI_DINAR = Currency.new(:KWD, 'د.ك', 'Kuwaiti Dinar'),
  84 + CAYMAN_ISLANDS_DOLLAR = Currency.new(:KYD, '$', 'Cayman Islands Dollar'),
  85 + KAZAKHSTANI_TENGE = Currency.new(:KZT, '〒', 'Kazakhstani Tenge'),
  86 + LAO_KIP = Currency.new(:LAK, '₭', 'Lao Kip'),
  87 + LEBANESE_LIRA = Currency.new(:LBP, 'ل.ل', 'Lebanese Lira'),
  88 + SRI_LANKAN_RUPEE = Currency.new(:LKR, '₨', 'Sri Lankan Rupee'),
  89 + LIBERIAN_DOLLAR = Currency.new(:LRD, '$', 'Liberian Dollar'),
  90 + LESOTHO_LOTI = Currency.new(:LSL, 'L', 'Lesotho Loti'),
  91 + LITHUANIAN_LITAS = Currency.new(:LTL, 'Lt', 'Lithuanian Litas'),
  92 + LATVIAN_LATS = Currency.new(:LVL, 'Ls', 'Latvian Lats'),
  93 + LIBYAN_DINAR = Currency.new(:LYD, 'ل.د', 'Libyan Dinar'),
  94 + MOROCCAN_DIRHAM = Currency.new(:MAD, 'د.م.', 'Moroccan Dirham'),
  95 + MOLDOVAN_LEU = Currency.new(:MDL, 'L', 'Moldovan Leu'),
  96 + MALAGASY_ARIARY = Currency.new(:MGA, '', 'Malagasy Ariary'),
  97 + MACEDONIAN_DENAR = Currency.new(:MKD, 'ден', 'Macedonian Denar'),
  98 + MYANMAR_KYAT = Currency.new(:MMK, 'K', 'Myanmar Kyat'),
  99 + MONGOLIAN_TOGROG = Currency.new(:MNT, '₮', 'Mongolian Tögrög'),
  100 + MACANESE_PATACA = Currency.new(:MOP, 'P', 'Macanese Pataca'),
  101 + MAURITANIAN_OUGUIYA = Currency.new(:MRO, 'UM', 'Mauritanian Ouguiya'),
  102 + MAURITIAN_RUPEE = Currency.new(:MUR, '₨', 'Mauritian Rupee'),
  103 + MALDIVIAN_RUFIYAA = Currency.new(:MVR, 'ރ.', 'Maldivian Rufiyaa'),
  104 + MALAWIAN_KWACHA = Currency.new(:MWK, 'MK', 'Malawian Kwacha'),
  105 + MEXICAN_PESO = Currency.new(:MXN, '$', 'Mexican Peso'),
  106 + MALAYSIAN_RINGGIT = Currency.new(:MYR, 'RM', 'Malaysian Ringgit'),
  107 + MOZAMBICAN_METICAL = Currency.new(:MZN, 'MTn', 'Mozambican Metical'),
  108 + NAMIBIAN_DOLLAR = Currency.new(:NAD, '$', 'Namibian Dollar'),
  109 + NIGERIAN_NAIRA = Currency.new(:NGN, '₦', 'Nigerian Naira'),
  110 + NICARAGUAN_CORDOBA = Currency.new(:NIO, 'C$', 'Nicaraguan Córdoba'),
  111 + NORWEGIAN_KRONE = Currency.new(:NOK, 'kr', 'Norwegian Krone'),
  112 + NEPALESE_RUPEE = Currency.new(:NPR, '₨', 'Nepalese Rupee'),
  113 + NEW_ZEALAND_DOLLAR = Currency.new(:NZD, '$', 'New Zealand Dollar'),
  114 + OMANI_RIAL = Currency.new(:OMR, 'ر.ع.', 'Omani Rial'),
  115 + PANAMANIAN_BALBOA = Currency.new(:PAB, 'B/.', 'Panamanian Balboa'),
  116 + PERUVIAN_NUEVO_SOL = Currency.new(:PEN, 'S/.', 'Peruvian Nuevo Sol'),
  117 + PAPUA_NEW_GUINEAN_KINA = Currency.new(:PGK, 'K', 'Papua New Guinean Kina'),
  118 + PHILIPPINE_PESO = Currency.new(:PHP, '₱', 'Philippine Peso'),
  119 + PAKISTANI_RUPEE = Currency.new(:PKR, '₨', 'Pakistani Rupee'),
  120 + POLISH_ZLOTY = Currency.new(:PLN, 'zł', 'Polish Złoty'),
  121 + PARAGUAYAN_GUARANI = Currency.new(:PYG, '₲', 'Paraguayan Guaraní'),
  122 + QATARI_RIYAL = Currency.new(:QAR, 'ر.ق', 'Qatari Riyal'),
  123 + ROMANIAN_LEU = Currency.new(:RON, 'L', 'Romanian Leu'),
  124 + SERBIAN_DINAR = Currency.new(:RSD, 'дин.', 'Serbian Dinar'),
  125 + RUSSIAN_RUBLE = Currency.new(:RUB, 'руб.', 'Russian Ruble'),
  126 + RWANDAN_FRANC = Currency.new(:RWF, 'Fr', 'Rwandan Franc'),
  127 + SAUDI_RIYAL = Currency.new(:SAR, 'ر.س', 'Saudi Riyal'),
  128 + SOLOMON_ISLANDS_DOLLAR = Currency.new(:SBD, '$', 'Solomon Islands Dollar'),
  129 + SEYCHELLOIS_RUPEE = Currency.new(:SCR, '₨', 'Seychellois Rupee'),
  130 + SUDANESE_POUND = Currency.new(:SDG, '£', 'Sudanese Pound'),
  131 + SWEDISH_KRONA = Currency.new(:SEK, 'kr', 'Swedish Krona'),
  132 + SINGAPORE_DOLLAR = Currency.new(:SGD, '$', 'Singapore Dollar'),
  133 + SAINT_HELENIAN_POUND = Currency.new(:SHP, '£', 'Saint Helenian Pound'),
  134 + SLOVAK_KORUNA = Currency.new(:SKK, 'Sk', 'Slovak Koruna'),
  135 + SIERRA_LEONEAN_LEONE = Currency.new(:SLL, 'Le', 'Sierra Leonean Leone'),
  136 + SOMALI_SHILLING = Currency.new(:SOS, 'Sh', 'Somali Shilling'),
  137 + SURINAMESE_DOLLAR = Currency.new(:SRD, '$', 'Surinamese Dollar'),
  138 + SAO_TOME_AND_PRINCIPE_DOBRA = Currency.new(:STD, 'Db', 'São Tomé and Príncipe Dobra'),
  139 + SALVADORAN_COLON = Currency.new(:SVC, '₡', 'Salvadoran Colón'),
  140 + SYRIAN_POUND = Currency.new(:SYP, 'ل.س', 'Syrian Pound'),
  141 + SWAZI_LILANGENI = Currency.new(:SZL, 'L', 'Swazi Lilangeni'),
  142 + THAI_BAHT = Currency.new(:THB, '฿', 'Thai Baht'),
  143 + TAJIKISTANI_SOMONI = Currency.new(:TJS, 'ЅМ', 'Tajikistani Somoni'),
  144 + TURKMENISTANI_MANAT = Currency.new(:TMM, 'm', 'Turkmenistani Manat'),
  145 + TUNISIAN_DINAR = Currency.new(:TND, 'د.ت', 'Tunisian Dinar'),
  146 + TONGAN_PAANGA = Currency.new(:TOP, 'T$', 'Tongan Paʻanga'),
  147 + TURKISH_NEW_LIRA = Currency.new(:TRY, 'TL', 'Turkish New Lira'),
  148 + TRINIDAD_AND_TOBAGO_DOLLAR = Currency.new(:TTD, '$', 'Trinidad and Tobago Dollar'),
  149 + NEW_TAIWAN_DOLLAR = Currency.new(:TWD, '$', 'New Taiwan Dollar'),
  150 + TANZANIAN_SHILLING = Currency.new(:TZS, 'Sh', 'Tanzanian Shilling'),
  151 + UKRAINIAN_HRYVNIA = Currency.new(:UAH, '₴', 'Ukrainian Hryvnia'),
  152 + UGANDAN_SHILLING = Currency.new(:UGX, 'Sh', 'Ugandan Shilling'),
  153 + UNITED_STATES_DOLLAR = Currency.new(:USD, '$', 'US Dollar'),
  154 + URUGUAYAN_PESO = Currency.new(:UYU, '$', 'Uruguayan Peso'),
  155 + UZBEKISTANI_SOM = Currency.new(:UZS, '', 'Uzbekistani Som'),
  156 + VENEZUELAN_BOLIVAR = Currency.new(:VEF, 'Bs F', 'Venezuelan Bolívar'),
  157 + VIETNAMESE_DONG = Currency.new(:VND, '₫', 'Vietnamese Đồng'),
  158 + VANUATU_VATU = Currency.new(:VUV, 'Vt', 'Vanuatu Vatu'),
  159 + SAMOAN_TALA = Currency.new(:WST, 'T', 'Samoan Tala'),
  160 + CENTRAL_AFRICAN_CFA_FRANC = Currency.new(:XAF, 'Fr', 'Central African Cfa Franc'),
  161 + EAST_CARIBBEAN_DOLLAR = Currency.new(:XCD, '$', 'East Caribbean Dollar'),
  162 + WEST_AFRICAN_CFA_FRANC = Currency.new(:XOF, 'Fr', 'West African Cfa Franc'),
  163 + CFP_FRANC = Currency.new(:XPF, 'Fr', 'Cfp Franc'),
  164 + YEMENI_RIAL = Currency.new(:YER, '﷼', 'Yemeni Rial'),
  165 + SOUTH_AFRICAN_RAND = Currency.new(:ZAR, 'R', 'South African Rand'),
  166 + ZAMBIAN_KWACHA = Currency.new(:ZMK, 'ZK', 'Zambian Kwacha'),
  167 + ZIMBABWEAN_DOLLAR = Currency.new(:ZWD, '$', 'Zimbabwean Dollar')
124 168 ]
125 169
126 170 CURRENCY_BY_CODE = Hash.new
263 lib/iso4217/iso4217.rb
@@ -2,53 +2,252 @@ module ISO4217
2 2 module CurrencyHelper
3 3
4 4 COUNTRIES = {
5   - :AF => AFGHANI,
  5 + :AF => AFGHAN_AFGHANI,
  6 + :AX => EURO,
  7 + :AL => ALBANIAN_LEK,
  8 + :DZ => ALGERIAN_DINAR,
  9 + :AS => UNITED_STATES_DOLLAR,
6 10 :AD => EURO,
7   - :AG => EAST_CARIBBEAN_DOLLAR,
  11 + :AO => ANGOLAN_KWANZA,
8 12 :AI => EAST_CARIBBEAN_DOLLAR,
9   - :AL => ALBANIAN_LEK,
  13 + :AG => EAST_CARIBBEAN_DOLLAR,
  14 + :AR => ARGENTINE_PESO,
10 15 :AM => ARMENIAN_DRAM,
11   - :AO => ANGOLAN_KWANZA,
12   - :AR => ARGENTINA_PESOS,
13   - :AS => AMERICAN_DOLLAR,
14   - :AT => EURO,
15   - :AU => AUSTRALIAN_DOLLAR,
16   - :AZ => AZERBAIJANIAN_MANAT,
17 16 :AW => ARUBAN_FLORIN,
18   - :BB => BARBADOS_DOLLAR,
  17 + :AU => AUSTRALIAN_DOLLAR,
  18 + :AT => EURO,
  19 + :AZ => AZERBAIJANI_MANAT,
  20 + :BS => BAHAMIAN_DOLLAR,
  21 + :BH => BAHRAINI_DINAR,
19 22 :BD => BANGLADESHI_TAKA,
  23 + :BB => BARBADIAN_DOLLAR,
  24 + :BY => BELARUSIAN_RUBLE,
20 25 :BE => EURO,
21   - :BG => EURO,
22   - :BH => BAHRAINI_DINAR,
23   - :BS => BAHAMAS_DOLLAR,
  26 + :BZ => BELIZE_DOLLAR,
  27 + :BJ => WEST_AFRICAN_CFA_FRANC,
  28 + :BM => BERMUDIAN_DOLLAR,
  29 + :BT => INDIAN_RUPEE,
  30 + :BO => BOLIVIAN_BOLIVIANO,
  31 + :BA => BOSNIA_AND_HERZEGOVINA_CONVERTIBLE_MARK,
  32 + :BW => BOTSWANA_PULA,
  33 + :BV => NORWEGIAN_KRONE,
  34 + :BR => BRAZILIAN_REAL,
  35 + :IO => UNITED_STATES_DOLLAR,
  36 + :BN => BRUNEI_DOLLAR,
  37 + :BG => BULGARIAN_LEV,
  38 + :BF => WEST_AFRICAN_CFA_FRANC,
  39 + :BI => BURUNDIAN_FRANC,
  40 + :KH => CAMBODIAN_RIEL,
  41 + :CM => CENTRAL_AFRICAN_CFA_FRANC,
24 42 :CA => CANADIAN_DOLLAR,
25   - :CZ => EURO,
26   - :DK => EURO,
  43 + :CV => CAPE_VERDEAN_ESCUDO,
  44 + :KY => CAYMAN_ISLANDS_DOLLAR,
  45 + :CF => CENTRAL_AFRICAN_CFA_FRANC,
  46 + :TD => CENTRAL_AFRICAN_CFA_FRANC,
  47 + :CL => CHILEAN_PESO,
  48 + :CN => CHINESE_RENMINBI_YUAN,
  49 + :CX => AUSTRALIAN_DOLLAR,
  50 + :CC => AUSTRALIAN_DOLLAR,
  51 + :CO => COLOMBIAN_PESO,
  52 + :KM => COMORIAN_FRANC,
  53 + :CG => CENTRAL_AFRICAN_CFA_FRANC,
  54 + :CD => CONGOLESE_FRANC,
  55 + :CK => NEW_ZEALAND_DOLLAR,
  56 + :CR => COSTA_RICAN_COLON,
  57 + :CI => WEST_AFRICAN_CFA_FRANC,
  58 + :HR => CROATIAN_KUNA,
  59 + :CU => CUBAN_PESO,
  60 + :CY => EURO,
  61 + :CZ => CZECH_KORUNA,
  62 + :DK => DANISH_KRONE,
  63 + :DJ => DJIBOUTIAN_FRANC,
  64 + :DM => EAST_CARIBBEAN_DOLLAR,
  65 + :DO => DOMINICAN_PESO,
  66 + :EC => UNITED_STATES_DOLLAR,
  67 + :EG => EGYPTIAN_POUND,
  68 + :SV => SALVADORAN_COLON,
  69 + :GQ => CENTRAL_AFRICAN_CFA_FRANC,
  70 + :ER => ERITREAN_NAKFA,
  71 + :EE => ESTONIAN_KROON,
  72 + :ET => ETHIOPIAN_BIRR,
  73 + :FK => FALKLAND_POUND,
  74 + :FO => DANISH_KRONE,
  75 + :FJ => FIJIAN_DOLLAR,
  76 + :FI => EURO,
  77 + :FR => EURO,
  78 + :GF => EURO,
  79 + :PF => CFP_FRANC,
  80 + :TF => EURO,
  81 + :GA => CENTRAL_AFRICAN_CFA_FRANC,
  82 + :GM => GAMBIAN_DALASI,
  83 + :GE => GEORGIAN_LARI,
27 84 :DE => EURO,
28   - :DZ => ALGERIAN_DINAR,
29   - :EE => EURO,
  85 + :GH => GHANAIAN_CEDI,
  86 + :GI => GIBRALTAR_POUND,
  87 + :GR => EURO,
  88 + :GL => DANISH_KRONE,
  89 + :GD => EAST_CARIBBEAN_DOLLAR,
  90 + :GP => EURO,
  91 + :GU => UNITED_STATES_DOLLAR,
  92 + :GT => GUATEMALAN_QUETZAL,
  93 + :GG => BRITISH_POUND,
  94 + :GN => GUINEAN_FRANC,
  95 + :GW => WEST_AFRICAN_CFA_FRANC,
  96 + :GY => GUYANESE_DOLLAR,
  97 + :HT => HAITIAN_GOURDE,
  98 + :HM => AUSTRALIAN_DOLLAR,
  99 + :VA => EURO,
  100 + :HN => HONDURAN_LEMPIRA,
  101 + :HK => HONG_KONG_DOLLAR,
  102 + :HU => HUNGARIAN_FORINT,
  103 + :IS => ICELANDIC_KRONA,
  104 + :IN => INDIAN_RUPEE,
  105 + :ID => INDONESIAN_RUPIAH,
  106 + :IR => IRANIAN_RIAL,
  107 + :IQ => IRAQI_DINAR,
30 108 :IE => EURO,
31   - :EL => EURO,
32   - :ES => EURO,
33   - :FR => EURO,
34   - :GB => BRITAIN_POUND,
  109 + :IM => BRITISH_POUND,
  110 + :IL => ISRAELI_NEW_SHEQEL,
35 111 :IT => EURO,
36   - :CY => EURO,
37   - :LV => EURO,
38   - :LT => EURO,
  112 + :JM => JAMAICAN_DOLLAR,
  113 + :JP => JAPANESE_YEN,
  114 + :JE => BRITISH_POUND,
  115 + :JO => JORDANIAN_DINAR,
  116 + :KZ => KAZAKHSTANI_TENGE,
  117 + :KE => KENYAN_SHILLING,
  118 + :KI => AUSTRALIAN_DOLLAR,
  119 + :KP => NORTH_KOREAN_WON,
  120 + :KR => SOUTH_KOREAN_WON,
  121 + :KW => KUWAITI_DINAR,
  122 + :KG => KYRGYZSTANI_SOM,
  123 + :LA => LAO_KIP,
  124 + :LV => LATVIAN_LATS,
  125 + :LB => LEBANESE_LIRA,
  126 + :LS => SOUTH_AFRICAN_RAND,
  127 + :LR => LIBERIAN_DOLLAR,
  128 + :LY => LIBYAN_DINAR,
  129 + :LI => SWISS_FRANC,
  130 + :LT => LITHUANIAN_LITAS,
39 131 :LU => EURO,
40   - :HU => EURO,
  132 + :MO => MACANESE_PATACA,
  133 + :MK => MACEDONIAN_DENAR,
  134 + :MG => MALAGASY_ARIARY,
  135 + :MW => MALAWIAN_KWACHA,
  136 + :MY => MALAYSIAN_RINGGIT,
  137 + :MV => MALDIVIAN_RUFIYAA,
  138 + :ML => WEST_AFRICAN_CFA_FRANC,
41 139 :MT => EURO,
  140 + :MH => UNITED_STATES_DOLLAR,
  141 + :MQ => EURO,
  142 + :MR => MAURITANIAN_OUGUIYA,
  143 + :MU => MAURITIAN_RUPEE,
  144 + :YT => EURO,
  145 + :MX => MEXICAN_PESO,
  146 + :FM => UNITED_STATES_DOLLAR,
  147 + :MD => MOLDOVAN_LEU,
  148 + :MC => EURO,
  149 + :MN => MONGOLIAN_TOGROG,
  150 + :ME => EURO,
  151 + :MS => EAST_CARIBBEAN_DOLLAR,
  152 + :MA => MOROCCAN_DIRHAM,
  153 + :MZ => MOZAMBICAN_METICAL,
  154 + :MM => MYANMAR_KYAT,
  155 + :NA => SOUTH_AFRICAN_RAND,
  156 + :NR => AUSTRALIAN_DOLLAR,
  157 + :NP => NEPALESE_RUPEE,
42 158 :NL => EURO,
43   - :PL => EURO,
  159 + :AN => NETHERLANDS_ANTILLEAN_GULDEN,
  160 + :NC => CFP_FRANC,
  161 + :NZ => NEW_ZEALAND_DOLLAR,
  162 + :NI => NICARAGUAN_CORDOBA,
  163 + :NE => WEST_AFRICAN_CFA_FRANC,
  164 + :NG => NIGERIAN_NAIRA,
  165 + :NU => NEW_ZEALAND_DOLLAR,
  166 + :NF => AUSTRALIAN_DOLLAR,
  167 + :MP => UNITED_STATES_DOLLAR,
  168 + :NO => NORWEGIAN_KRONE,
  169 + :OM => OMANI_RIAL,
  170 + :PK => PAKISTANI_RUPEE,
  171 + :PW => UNITED_STATES_DOLLAR,
  172 + :PS => UNITED_STATES_DOLLAR,
  173 + :PA => PANAMANIAN_BALBOA,
  174 + :PG => PAPUA_NEW_GUINEAN_KINA,
  175 + :PY => PARAGUAYAN_GUARANI,
  176 + :PE => PERUVIAN_NUEVO_SOL,
  177 + :PH => PHILIPPINE_PESO,
  178 + :PN => NEW_ZEALAND_DOLLAR,
  179 + :PL => POLISH_ZLOTY,
44 180 :PT => EURO,
45   - :RO => EURO,
46   - :SI => EURO,
  181 + :PR => UNITED_STATES_DOLLAR,
  182 + :QA => QATARI_RIYAL,
  183 + :RE => EURO,
  184 + :RO => ROMANIAN_LEU,
  185 + :RU => RUSSIAN_RUBLE,
  186 + :RW => RWANDAN_FRANC,
  187 + :BL => RWANDAN_FRANC,
  188 + :SH => RWANDAN_FRANC,
  189 + :KN => EAST_CARIBBEAN_DOLLAR,
  190 + :LC => EAST_CARIBBEAN_DOLLAR,
  191 + :MF => EURO,
  192 + :PM => EURO,
  193 + :VC => EAST_CARIBBEAN_DOLLAR,
  194 + :WS => SAMOAN_TALA,
  195 + :SM => EURO,
  196 + :ST => EURO,
  197 + :SA => SAUDI_RIYAL,
  198 + :SN => WEST_AFRICAN_CFA_FRANC,
  199 + :RS => SERBIAN_DINAR,
  200 + :SC => SEYCHELLOIS_RUPEE,
  201 + :SL => SIERRA_LEONEAN_LEONE,
  202 + :SG => SINGAPORE_DOLLAR,
47 203 :SK => EURO,
48   - :FI => EURO,
49   - :SE => EURO,
50   - :UK => BRITAIN_POUND,
51   - :US => AMERICAN_DOLLAR
  204 + :SI => EURO,
  205 + :SB => SOLOMON_ISLANDS_DOLLAR,
  206 + :SO => SOMALI_SHILLING,
  207 + :ZA => SOUTH_AFRICAN_RAND,
  208 + :GS => SOUTH_AFRICAN_RAND,
  209 + :ES => EURO,
  210 + :LK => SRI_LANKAN_RUPEE,
  211 + :SD => SUDANESE_POUND,
  212 + :SR => SURINAMESE_DOLLAR,
  213 + :SJ => NORWEGIAN_KRONE,
  214 + :SZ => SWAZI_LILANGENI,
  215 + :SE => SWEDISH_KRONA,
  216 + :CH => SWISS_FRANC,
  217 + :SY => SYRIAN_POUND,
  218 + :TW => NEW_TAIWAN_DOLLAR,
  219 + :TJ => TAJIKISTANI_SOMONI,
  220 + :TZ => TANZANIAN_SHILLING,
  221 + :TH => THAI_BAHT,
  222 + :TL => UNITED_STATES_DOLLAR,
  223 + :TG => WEST_AFRICAN_CFA_FRANC,
  224 + :TK => NEW_ZEALAND_DOLLAR,
  225 + :TO => TONGAN_PAANGA,
  226 + :TT => TRINIDAD_AND_TOBAGO_DOLLAR,
  227 + :TN => TUNISIAN_DINAR,
  228 + :TR => TURKISH_NEW_LIRA,
  229 + :TM => TURKMENISTANI_MANAT,
  230 + :TC => UNITED_STATES_DOLLAR,
  231 + :TV => AUSTRALIAN_DOLLAR,
  232 + :UG => UGANDAN_SHILLING,
  233 + :UA => UKRAINIAN_HRYVNIA,
  234 + :AE => UNITED_ARAB_EMIRATES_DIRHAM,
  235 + :GB => BRITISH_POUND,
  236 + :UK => BRITISH_POUND,
  237 + :US => UNITED_STATES_DOLLAR,
  238 + :UM => UNITED_STATES_DOLLAR,
  239 + :UY => URUGUAYAN_PESO,
  240 + :UZ => UZBEKISTANI_SOM,
  241 + :VU => VANUATU_VATU,
  242 + :VE => VENEZUELAN_BOLIVAR,
  243 + :VN => VIETNAMESE_DONG,
  244 + :VG => UNITED_STATES_DOLLAR,
  245 + :VI => UNITED_STATES_DOLLAR,
  246 + :WF => CFP_FRANC,
  247 + :EH => MOROCCAN_DIRHAM,
  248 + :YE => YEMENI_RIAL,
  249 + :ZM => ZAMBIAN_KWACHA,
  250 + :ZW => ZIMBABWEAN_DOLLAR
52 251 }
53 252
54 253 def currency_for(country_code, default_when_currency_not_found= :NAC)
463 spec/currencies_spec.rb
@@ -4,472 +4,21 @@
4 4 include ISO4217::CurrencyHelper
5 5
6 6 context "when searching for a currency" do
7   - it "returns the albanian leke" do
8   - currency(:ALL).should == ISO4217::ALBANIAN_LEK
9   - end
10   -
11   - it "returns the american dollar" do
12   - currency("USD").should == ISO4217::AMERICAN_DOLLAR
13   - end
14   -
15   - it "returns the afghani" do
16   - currency(:AFN).should == ISO4217::AFGHANI
17   - end
18   -
19   - it "returns the Algerian Dinar" do
20   - currency(:DZD).should == ISO4217::ALGERIAN_DINAR
21   - end
22   -
23   - it "returns the Angolan Kwanza" do
24   - currency(:AOA).should == ISO4217::ANGOLAN_KWANZA
25   - end
26   -
27   - it "returns the argentinian peso" do
28   - currency(:ARS).should == ISO4217::ARGENTINA_PESOS
29   - end
30   -
31   - it "returns the Armenian Dran" do
32   - currency(:AMD).should == ISO4217::ARMENIAN_DRAM
33   - end
34   -
35   - it "returns the Aruban florin" do
36   - currency(:AWG).should == ISO4217::ARUBAN_FLORIN
37   - end
38   -
39   - it "returns the australian dollar" do
40   - currency(:AUD).should == ISO4217::AUSTRALIAN_DOLLAR
41   - end
42   -
43   - it "returns the azerbaijanian manat" do
44   - currency(:AZN).should == ISO4217::AZERBAIJANIAN_MANAT
45   - end
46   -
47   - it "returns the bahamian dollar" do
48   - currency(:BSD).should == ISO4217::BAHAMAS_DOLLAR
49   - end
50   -
51   - it "returns the Bahrani dinar" do
52   - currency(:BHD).should == ISO4217::BAHRAINI_DINAR
53   - end
54   -
55   - it "returns the Bangladeshi taka" do
56   - currency(:BDT).should == ISO4217::BANGLADESHI_TAKA
57   - end
58   -
59   - it "returns the barbados dollar" do
60   - currency(:BBD).should == ISO4217::BARBADOS_DOLLAR
61   - end
62   -
63   - it "returns the belarusian ruble" do
64   - currency(:BYR).should == ISO4217::BELARUS_RUBLE
65   - end
66   -
67   - it "returns the belize dollar" do
68   - currency(:BZD).should == ISO4217::BELIZE_DOLLAR
69   - end
70   -
71   - it "returns the bermudian dollar" do
72   - currency(:BMD).should == ISO4217::BERMUDA_DOLLARS
73   - end
74   -
75   - it "returns the boliviano" do
76   - currency(:BOB).should == ISO4217::BOLIVIA_BOLIVIANOS
77   - end
78   -
79   - it "returns the convertible marks" do
80   - currency(:BAM).should == ISO4217::CONVERTIBLE_MARKA
81   - end
82   -
83   - it "returns the pula" do
84   - currency(:BWP).should == ISO4217::BOTSWANA_PULAS
85   - end
86   -
87   - it "returns the bulgarian lev" do
88   - currency(:BGN).should == ISO4217::BULGARIAN_LEVA
89   - end
90   -
91   - it "returns the brazilian real" do
92   - currency(:BRL).should == ISO4217::BRAZILIAN_REAL
93   - end
94   -
95 7 it "returns the british pound" do
96   - currency(:GBP).should == ISO4217::BRITAIN_POUND
97   - end
98   -
99   - it "returns the brunei dollar" do
100   - currency(:BND).should == ISO4217::BRUNEI_DARUSSALAM_DOLLAR
101   - end
102   -
103   - it "returns the cambodian cambodian riel" do
104   - currency(:KHR).should == ISO4217::CAMBODIAN_RIELS
105   - end
106   -
107   - it "returns the canadian dollar" do
108   - currency(:CAD).should == ISO4217::CANADIAN_DOLLAR
109   - end
110   -
111   - it "returns the Cayman Islands dollar" do
112   - currency(:KYD).should == ISO4217::CAYMAN_ISLANDS_DOLLARS
113   - end
114   -
115   - it "returns the chilean peso" do
116   - currency(:CLP).should == ISO4217::CHILE_PESOS
117   - end
118   -
119   - it "returns the chinese yuan" do
120   - currency(:CNY).should == ISO4217::CHINA_YUAN_RENMINBI
  8 + currency(:GBP).should == ISO4217::BRITISH_POUND
121 9 end
122 10
123   - it "returns the colombian peso" do
124   - currency(:COP).should == ISO4217::COLOMBIAN_PESO
  11 + it "returns the United States dollar" do
  12 + currency(:USD).should == ISO4217::UNITED_STATES_DOLLAR
125 13 end
126 14
127   - it "returns the Costa Rican colon" do
128   - currency(:CRC).should == ISO4217::COSTA_RICA_COLON
129   - end
130   -
131   - it "returns the croatian kuna" do
132   - currency(:HRK).should == ISO4217::CROATIAN_KUNA
133   - end
134   -
135   - it "returns the cuban peso" do
136   - currency(:CUP).should == ISO4217::CUBA_PESOS
137   - end
138   -
139   - it "returns the czech koruna" do
140   - currency(:CZK).should == ISO4217::CZECH_KORUNA
141   - end
142   -
143   - it "returns the denmark kroner" do
144   - currency(:DKK).should == ISO4217::DENMARK_KRONER
145   - end
146   -
147   - it "returns the dominican republic peso" do
148   - currency(:DOP).should == ISO4217::DOMINICAN_REPUBLIC_PESOS
149   - end
150   -
151   - it "returns the east caribbean dollars" do
152   - currency(:XCD).should == ISO4217::EAST_CARIBBEAN_DOLLAR
153   - end
154   -
155   - it "returns the egypt pound" do
156   - currency(:EGP).should == ISO4217::EGYPT_POUND
157   - end
158   -
159   - it "returns the salvador colon" do
160   - currency(:SVC).should == ISO4217::EL_SALVADOR_COLON
161   - end
162   -
163   - it "returns the estonian krooni" do
164   - currency(:EEK).should == ISO4217::ESTONIAN_KROONI
165   - end
166   -
167   - it "returns the euro " do
  15 + it "returns the Euro" do
168 16 currency(:EUR).should == ISO4217::EURO
169 17 end
170 18
171   - it "returns the falkland islands pound" do
172   - currency(:FKP).should == ISO4217::FALKLAND_ISLANDS_POUND
173   - end
174   -
175   - it "returns the fiji dollar" do
176   - currency(:FJD).should == ISO4217::FIJI_DOLLAR
177   - end
178   -
179   - it "returns the ghana cedi" do
180   - currency(:GHC).should == ISO4217::GHANA_CEDI
181   - end
182   -
183   - it "returns the gibraltar pound" do
184   - currency(:GIP).should == ISO4217::GIBRLATAR_POUND
185   - end
186   -
187   - it "returns the guatemala quetzales" do
188   - currency(:GTQ).should == ISO4217::GUATEMALA_QUEZALES
189   - end
190   -
191   - it "returns the guernsey pound" do
192   - currency(:GGP).should == ISO4217::GUERNSEY_POUND
193   - end
194   -
195   - it "returns the guyana dollar" do
196   - currency(:GYD).should == ISO4217::GUYANA_DOLLAR
197   - end
198   -
199   - it "returns the honduras lempiras" do
200   - currency(:HNL).should == ISO4217::HONDURAS_LEMPIRAS
201   - end
202   -
203   - it "returns the hong kong dollar" do
204   - currency(:HKD).should == ISO4217::HONG_KONG_DOLLAR
205   - end
206   -
207   - it "returns the hungarian forint" do
208   - currency(:HUF).should == ISO4217::HUNGARY_FORINT
209   - end
210   -
211   - it "returns the icelandic kronur" do
212   - currency(:ISK).should == ISO4217::ICELAND_KRONUR
213   - end
214   -
215   - it "returns the indian rupee" do
216   - currency(:INR).should == ISO4217::INDIAN_RUPEE
217   - end
218   -
219   - it "returns the indonesian Rupiah" do
220   - currency(:IDR).should == ISO4217::INDONESIAN_RUPIAH
221   - end
222   -
223   - it "returns the iranian rial" do
224   - currency(:IRR).should == ISO4217::IRAN_RIALS
225   - end
226   -
227   - it "returns the isle of man pound" do
228   - currency(:IMP).should == ISO4217::ISLE_OF_MAN_POUND
229   - end
230   -
231   - it "returns the israel new shekel" do
232   - currency(:ILS).should == ISO4217::ISRAEL_NEW_SHEKEL
233   - end
234   -
235   - it "returns the jamaica dollar" do
236   - currency(:JMD).should == ISO4217::JAMAICA_DOLLAR
237   - end
238   -
239   - it "returns the japanese jen" do
240   - currency(:JPY).should == ISO4217::JAPAN_YEN
241   - end
242   -
243   - it "returns the jersey pound" do
244   - currency(:JEP).should == ISO4217::JERSEY_POUND
245   - end
246   -
247   - it "returns the kazakhstan tenge" do
248   - currency(:KZT).should == ISO4217::KAZAKHSTAN_TENGE
249   - end
250   -
251   - it "returns the north korean won" do
252   - currency(:KPW).should == ISO4217::NORTH_KOREAN_WON
253   - end
254   -
255   - it "returns the south korean won" do
256   - currency(:KRW).should == ISO4217::SOUTH_KOREAN_WON
257   - end
258   -
259   - it "returns the kyrgyzstan soms" do
260   - currency(:KGS).should == ISO4217::KYRGYZSTAN_SOMS
261   - end
262   -
263   - it "returns the laos kip" do
264   - currency(:LAK).should == ISO4217::LAOS_KIPS
265   - end
266   -
267   - it "returns the latvian lati" do
268   - currency(:LVL).should == ISO4217::LATVIAN_LATI
269   - end
270   -
271   - it "returns the lebanese pound" do
272   - currency(:LBP).should == ISO4217::LEBANON_POUND
273   - end
274   -
275   - it "returns the liberian dollar" do
276   - currency(:LRD).should == ISO4217::LIBERIA_DOLLARS
277   - end
278   -
279   - it "returns the swiss francs" do
280   - currency(:CHF).should == ISO4217::SWITZERLAND_FRANCS
281   - end
282   -
283   - it "returns the lithuanian litai" do
284   - currency(:LTL).should == ISO4217::LITHUANIA_LITAI
285   - end
286   -
287   - it "returns the macedonian denar" do
288   - currency(:MKD).should == ISO4217::MACEDONIA_DENARS
289   - end
290   -
291   - it "returns the malaysan ringgit" do
292   - currency(:MYR).should == ISO4217::MALAYSIA_RINGGITS
293   - end
294   -
295   - it "returns the mauritius rupee" do
296   - currency(:MUR).should == ISO4217::MAURITIUS_RUPEES
297   - end
298   -
299   - it "returns the mexican peso" do
300   - currency(:MXN).should == ISO4217::MEXICO_PESOS
301   - end
302   -
303   - it "returns the mongolian tugrik" do
304   - currency(:MNT).should == ISO4217::MONGOLIA_TUGRIKS
305   - end
306   -
307   - it "returns the mozambique metical" do
308   - currency(:MZN).should == ISO4217::MOZAMBIQUE_METICALS
309   - end
310   -
311   - it "returns the namibian dollar" do
312   - currency(:NAD).should == ISO4217::NAMIBIA_DOLLARS
313   - end
314   -
315   - it "returns the nepal rupee" do
316   - currency(:NPR).should == ISO4217::NEPAL_RUPEES
317   - end
318   -
319   - it "returns the netherland antilles guilders" do
320   - currency(:ANG).should == ISO4217::NETHERLANDS_ANTILLES_GUILDERS
321   - end
322   -
323   - it "returns the new zealand dollar" do
324   - currency(:NZD).should == ISO4217::NEW_ZEALAND_DOLLARS
325   - end
326   -
327   - it "returns the nicaraguan cordoba" do
328   - currency(:NIO).should == ISO4217::NICARAGUA_CORDOBAS
329   - end
330   -
331   - it "returns the nigerian naira" do
332   - currency(:NGN).should == ISO4217::NIGERIA_NAIRAS
333   - end
334   -
335   - it "returns the norwegian krone" do
336   - currency(:NOK).should == ISO4217::NORWAY_KRONE
337   - end
338   -
339   - it "returns the oman rial" do
340   - currency(:OMR).should == ISO4217::OMAN_RIALS
341   - end
342   -
343   - it "returns the pakistan rupee" do
344   - currency(:PKR).should == ISO4217::PAKISTAN_RUPEES
345   - end
346   -
347   - it "returns the panaman balboa" do
348   - currency(:PAB).should == ISO4217::PANAMA_BALBOA
349   - end
350   -
351   - it "returns the paraguayan guarani" do
352   - currency(:PYG).should == ISO4217::PARAGUAY_GUARANI
353   - end
354   -
355   - it "returns the peruvian nuevo soles" do
356   - currency(:PEN).should == ISO4217::PERU_NUEVOS_SOLES
357   - end
358   -
359   - it "returns the philippines peso" do
360   - currency(:PHP).should == ISO4217::PHILIPPINES_PESOS
361   - end
362   -
363   - it "returns the polish zlotych" do
364   - currency(:PLN).should == ISO4217::POLAND_ZLOTYCH
365   - end
366   -
367   - it "returns the qatar rials" do
368   - currency(:QAR).should == ISO4217::QATAR_RIALS
369   - end
370   -
371   - it "returns the romanian new lei" do
372   - currency(:RON).should == ISO4217::ROMANIA_NEW_LEI
373   - end
374   -
375   - it "returns the russian ruble" do
376   - currency(:RUB).should == ISO4217::RUSSIA_RUBLES
377   - end
378   -
379   - it "returns the saint helena pound" do
380   - currency(:SHP).should == ISO4217::SAINT_HELENA_POUNDS
381   - end
382   -
383   - it "returns the saudi arabian riyal" do
384   - currency(:SAR).should == ISO4217::SAUDI_ARABIA_RIYALS
385   - end
386   -
387   - it "returns the serbian dinar" do
388   - currency(:RSD).should == ISO4217::SERBIA_DINARS
389   - end
390   -
391   - it "returns the seychelies rupee" do
392   - currency(:SCR).should == ISO4217::SEYCHELIES_RUPEES
393   - end
394   -
395   - it "returns the singapore dollar" do
396   - currency(:SGD).should == ISO4217::SINGAPORE_DOLLARS
397   - end
398   -
399   - it "returns the solomon islands dollar" do
400   - currency(:SBD).should == ISO4217::SOLOMON_ISLANDS_DOLLARS
401   - end
402   -
403   - it "returns the somalia shilling" do
404   - currency(:SOS).should == ISO4217::SOMALIA_SHILLINGS
405   - end
406   -
407   - it "returns the south african rand" do
408   - currency(:ZAR).should == ISO4217::SOUTH_AFRICA_RAND
409   - end
410   -
411   - it "returns the sri lanka rupee" do
412   - currency(:LKR).should == ISO4217::SRI_LANKA_RUPEES
413   - end
414   -
415   - it "returns the swedish kronor" do
416   - currency(:SEK).should == ISO4217::SWEDEN_KRONOR
417   - end
418   -
419   - it "returns the swiss frnac" do
420   - currency(:CHF).should == ISO4217::SWITZERLAND_FRANCS
421   - end
422   -
423   - it "returns the suriname dollar" do
424   - currency(:SRD).should == ISO4217::SURINAME_DOLLARS
425   - end
426   -
427   - it "returns the syirian pound" do
428   - currency(:SYP).should == ISO4217::SYRIA_POUNDS
429   - end
430   -
431   - it "returns the taiwanese new dollar" do
432   - currency(:TWD).should == ISO4217::TAIWAN_NEW_DOLLARS
433   - end
434   -
435   - it "returns the thailand baht" do
436   - currency(:THB).should == ISO4217::THAILAND_BAHT
437   - end
438   -
439   - it "returns the trinidad and tobago dollar" do
440   - currency(:TTD).should == ISO4217::TRINIDAD_AND_TOBAGO_DOLLARS
441   - end
442   -
443   - it "returns the turkish lira" do
444   - currency(:TRY).should == ISO4217::TURKEY_LIRA
445   - end
446   -
447   - it "returns the tuvalu dollar" do
448   - currency(:TVD).should == ISO4217::TUVALU_DOLLARS
449   - end
450   -
451   - it "returns the ukraine hryvnia" do
452   - currency(:UAH).should == ISO4217::UKRAINE_HRYVNIA
453   - end
454   -
455   - it "returns the uruguay peso" do
456   - currency(:UYU).should == ISO4217::URUGUAY_PESOS
457   - end
458   -
459   - it "returns the uzbekistan sums" do
460   - currency(:UZS).should == ISO4217::UZBEKISTAN_SUMS
461   - end
462   -
463   - it "returns the venezuelan bolivar fuerte" do
464   - currency(:VEF).should == ISO4217::VENEZUELA_BOLIVARES_FUERTES
465   - end
466   -
467   - it "returns the vietnamese dong" do
468   - currency(:VND).should == ISO4217::VIETNAM_DONG
  19 + it "returns the Cayman Islands dollar" do
  20 + currency(:KYD).should == ISO4217::CAYMAN_ISLANDS_DOLLAR
469 21 end
470 22
471   - it "returns the yemen rials" do
472   - currency(:YER).should == ISO4217::YEMEN_RIALS
473   - end
474 23 end
475 24 end
92 spec/iso4217_spec.rb
@@ -4,8 +4,8 @@
4 4
5 5 include ISO4217::CurrencyHelper
6 6
7   - EURO_COUNTRIES = [:AD, :AT, :BE, :BG, :CY, :CZ, :DK, :DE, :EE, :IE, :EL, :ES, :FR, :IT, :LV, :LT, :LU, :HU,
8   - :MT, :NL, :PL, :PT, :RO, :SI, :SK, :FI, :SE]
  7 + EURO_COUNTRIES = [:AD, :AT, :BE, :CY, :DE, :IE, :ES, :FR, :IT, :LU,
  8 + :MT, :NL, :PT, :SI, :SK, :FI, :GR, :MC, :ME, :SM, :SI]
9 9
10 10 context "finding currency codes for known countries" do
11 11 it "returns the currency euro code of the countries in the euro zone" do
@@ -79,6 +79,10 @@
79 79 currency_code_for(:BS).should == 'BSD'
80 80 end
81 81
  82 + it "returns the currency code for Bulgaria" do
  83 + currency_code_for(:BG).should == 'BGN'
  84 + end
  85 +
82 86 it "returns the currency code for Bahrain" do
83 87 currency_code_for(:BH).should == 'BHD'
84 88 end
@@ -91,6 +95,42 @@
91 95 currency_code_for(:BB).should == 'BBD'
92 96 end
93 97
  98 + it "returns the currency code for Czech Republic" do
  99 + currency_code_for(:CZ).should == 'CZK'
  100 + end
  101 +
  102 + it "returns the currency code for Denmark" do
  103 + currency_code_for(:DK).should == 'DKK'
  104 + end
  105 +
  106 + it "returns the currency code for Estonia" do
  107 + currency_code_for(:EE).should == 'EEK'
  108 + end
  109 +
  110 + it "returns the currency code for Latvia" do
  111 + currency_code_for(:LV).should == 'LVL'
  112 + end
  113 +
  114 + it "returns the currency code for Lithuania" do
  115 + currency_code_for(:LT).should == 'LTL'
  116 + end
  117 +
  118 + it "returns the currency code for Hungary" do
  119 + currency_code_for(:HU).should == 'HUF'
  120 + end
  121 +
  122 + it "returns the currency code for Poland" do
  123 + currency_code_for(:PL).should == 'PLN'
  124 + end
  125 +
  126 + it "returns the currency code for Romania" do
  127 + currency_code_for(:RO).should == 'RON'
  128 + end
  129 +
  130 + it "returns the currency code for Sweden" do
  131 + currency_code_for(:SE).should == 'SEK'
  132 + end
  133 +
94 134 end
95 135
96 136 context "finding currency codes of unknown countries" do
@@ -124,11 +164,11 @@
124 164 end
125 165
126 166 it "returns the Albanian Lek sign for Albania" do
127   - currency_sign_for(:AL).should == "Lek"
  167 + currency_sign_for(:AL).should == "L"
128 168 end
129 169
130 170 it "returns the Algerian Dinar sign for Algeria" do
131   - currency_sign_for(:DZ).should == "DA"
  171 + currency_sign_for(:DZ).should == "د.ج"
132 172 end
133 173
134 174 it "returns the dollar sign for American Samoa" do
@@ -152,11 +192,11 @@
152 192 end
153 193
154 194 it "returns the Armenian dram sign for Armenia" do
155   - currency_sign_for(:AM).should == "Դ"
  195 + currency_sign_for(:AM).should == "դր."
156 196 end
157 197
158 198 it "returns the Aruban florin sign for Aruba" do
159   - currency_sign_for(:AW).should == "Afl"
  199 + currency_sign_for(:AW).should == "ƒ"
160 200 end
161 201
162 202 it "returns the Australian dollar sign for Australia" do
@@ -172,7 +212,7 @@
172 212 end
173 213
174 214 it "returns the Bahraini dinar sign for Bahrain" do
175   - currency_sign_for(:BH).should == "BD"
  215 + currency_sign_for(:BH).should == "ب.د"
176 216 end
177 217
178 218 it "returns the Bangladeshi taka sign for Bangladesh" do
@@ -199,84 +239,84 @@
199 239 end
200 240
201 241 it "returns the currency object for GBP when searching for the currency in Great Britain" do
202   - [:GB, :UK].each {|country| currency_for(country).should == ISO4217::BRITAIN_POUND}
  242 + [:GB, :UK].each {|country| currency_for(country).should == ISO4217::BRITISH_POUND}
203 243 end
204 244
205 245 it "returns the currency object for the dollar if searching for the American currency" do
206   - currency_for(:US).should == ISO4217::AMERICAN_DOLLAR
  246 + currency_for(:US).should == ISO4217::UNITED_STATES_DOLLAR
207 247 end
208 248 end
209 249
210 250 context "name of a currency" do
211 251 it "returns the (human readable) name of the euro" do
212   - ISO4217::EURO.name.should == 'euro'
  252 + ISO4217::EURO.name.should == 'Euro'
213 253 end
214 254
215 255 it "returns the (human readable) name of the Canadian dollar" do
216   - currency_for(:CA).name.should == 'Canadian dollar'
  256 + currency_for(:CA).name.should == 'Canadian Dollar'
217 257 end
218 258
219 259 it "returns the (human readable) name of the pound sterling" do
220   - ISO4217::BRITAIN_POUND.name.should == 'Pound sterling'
  260 + ISO4217::BRITISH_POUND.name.should == 'Pound Sterling'
221 261 end
222 262
223 263 it "returns the (human readable) name of the US dollar" do
224   - ISO4217::AMERICAN_DOLLAR.name.should == 'US dollar'
  264 + ISO4217::UNITED_STATES_DOLLAR.name.should == 'US Dollar'