Class: CountryCurrency::Code
- Inherits:
-
Object
- Object
- CountryCurrency::Code
show all
- Includes:
- Singleton
- Defined in:
- lib/country_currency/code.rb,
lib/country_currency/calling.rb,
lib/country_currency/iso_4217.rb,
lib/country_currency/continent.rb,
lib/country_currency/iso_3166_1.rb,
lib/country_currency/iso_13616_1.rb
Direct Known Subclasses
ABW, AFG, AGO, AIA, ALA, ALB, AND, ARE, ARG, ARM, ASM, ATA, ATF, ATG, AUS, AUT, AZE, BDI, BEL, BEN, BES, BFA, BGD, BGR, BHR, BHS, BIH, BLM, BLR, BLZ, BMU, BOL, BRA, BRB, BRN, BTN, BVT, BWA, CAF, CAN, CCK, CHE, CHL, CHN, CIV, CMR, COD, COG, COK, COL, COM, CPV, CRI, CUB, CUW, CXR, CYM, CYP, CZE, DEU, DJI, DMA, DNK, DOM, DZA, ECU, EGY, ERI, ESH, ESP, EST, ETH, FIN, FJI, FLK, FRA, FRO, FSM, GAB, GBR, GEO, GGY, GHA, GIB, GIN, GLP, GMB, GNB, GNQ, GRC, GRD, GRL, GTM, GUF, GUM, GUY, HKG, HMD, HND, HRV, HTI, HUN, IDN, IMN, IND, IOT, IRL, IRN, IRQ, ISL, ISR, ITA, JAM, JEY, JOR, JPN, KAZ, KEN, KGZ, KHM, KIR, KNA, KOR, KWT, LAO, LBN, LBR, LBY, LCA, LIE, LKA, LSO, LTU, LUX, LVA, MAC, MAF, MAR, MCO, MDA, MDG, MDV, MEX, MHL, MKD, MLI, MLT, MMR, MNE, MNG, MNP, MOZ, MRT, MSR, MTQ, MUS, MWI, MYS, MYT, NAM, NCL, NER, NFK, NGA, NIC, NIU, NLD, NOR, NPL, NRU, NZL, OMN, PAK, PAN, PCN, PER, PHL, PLW, PNG, POL, PRI, PRK, PRT, PRY, PSE, PYF, QAT, REU, ROU, RUS, RWA, SAU, SDN, SEN, SGP, SGS, SHN, SJM, SLB, SLE, SLV, SMR, SOM, SPM, SRB, SSD, STP, SUR, SVK, SVN, SWE, SWZ, SXM, SYC, SYR, TCA, TCD, TGO, THA, TJK, TKL, TKM, TLS, TON, TTO, TUN, TUR, TUV, TWN, TZA, UGA, UKR, UMI, URY, USA, UZB, VAT, VCT, VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE
Defined Under Namespace
Classes: ABW, AFG, AGO, AIA, ALA, ALB, AND, ARE, ARG, ARM, ASM, ATA, ATF, ATG, AUS, AUT, AZE, BDI, BEL, BEN, BES, BFA, BGD, BGR, BHR, BHS, BIH, BLM, BLR, BLZ, BMU, BOL, BRA, BRB, BRN, BTN, BVT, BWA, CAF, CAN, CCK, CHE, CHL, CHN, CIV, CMR, COD, COG, COK, COL, COM, CPV, CRI, CUB, CUW, CXR, CYM, CYP, CZE, DEU, DJI, DMA, DNK, DOM, DZA, ECU, EGY, ERI, ESH, ESP, EST, ETH, FIN, FJI, FLK, FRA, FRO, FSM, GAB, GBR, GEO, GGY, GHA, GIB, GIN, GLP, GMB, GNB, GNQ, GRC, GRD, GRL, GTM, GUF, GUM, GUY, HKG, HMD, HND, HRV, HTI, HUN, IDN, IMN, IND, IOT, IRL, IRN, IRQ, ISL, ISR, ITA, JAM, JEY, JOR, JPN, KAZ, KEN, KGZ, KHM, KIR, KNA, KOR, KWT, LAO, LBN, LBR, LBY, LCA, LIE, LKA, LSO, LTU, LUX, LVA, MAC, MAF, MAR, MCO, MDA, MDG, MDV, MEX, MHL, MKD, MLI, MLT, MMR, MNE, MNG, MNP, MOZ, MRT, MSR, MTQ, MUS, MWI, MYS, MYT, NAM, NCL, NER, NFK, NGA, NIC, NIU, NLD, NOR, NPL, NRU, NZL, OMN, PAK, PAN, PCN, PER, PHL, PLW, PNG, POL, PRI, PRK, PRT, PRY, PSE, PYF, QAT, REU, ROU, RUS, RWA, SAU, SDN, SEN, SGP, SGS, SHN, SJM, SLB, SLE, SLV, SMR, SOM, SPM, SRB, SSD, STP, SUR, SVK, SVN, SWE, SWZ, SXM, SYC, SYR, TCA, TCD, TGO, THA, TJK, TKL, TKM, TLS, TON, TTO, TUN, TUR, TUV, TWN, TZA, UGA, UKR, UMI, URY, USA, UZB, VAT, VCT, VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE
Constant Summary
collapse
- @@codes =
[]
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.alpha2 ⇒ Object
Returns the value of attribute alpha2.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def alpha2
@alpha2
end
|
.alpha3 ⇒ Object
Returns the value of attribute alpha3.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def alpha3
@alpha3
end
|
.calling ⇒ Object
Also known as:
calling_code
Returns the value of attribute calling.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def calling
@calling
end
|
.continent ⇒ Object
Returns the value of attribute continent.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def continent
@continent
end
|
.currencies ⇒ Object
76
77
78
79
80
81
82
|
# File 'lib/country_currency/code.rb', line 76
def currencies
if defined? @currencies
return @currencies
else
return [@main_currency]
end
end
|
.currency_symbol ⇒ Object
Returns the value of attribute currency_symbol.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def currency_symbol
@currency_symbol
end
|
.iban ⇒ Object
84
85
86
87
|
# File 'lib/country_currency/code.rb', line 84
def iban
return @iban if defined? @iban
end
|
.main_currency ⇒ Object
Also known as:
currency
Returns the value of attribute main_currency.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def main_currency
@main_currency
end
|
.name ⇒ Object
Returns the value of attribute name.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def name
@name
end
|
.numeric ⇒ Object
Returns the value of attribute numeric.
57
58
59
|
# File 'lib/country_currency/code.rb', line 57
def numeric
@numeric
end
|
Class Method Details
.all ⇒ Object
68
69
70
|
# File 'lib/country_currency/code.rb', line 68
def all
@@codes.uniq
end
|
.for_select(type = :alpha2) ⇒ Object
72
73
74
|
# File 'lib/country_currency/code.rb', line 72
def for_select(type = :alpha2)
all.map { |country| [country.name, country.send(type)] }
end
|
.inherited(code) ⇒ Object
63
64
65
66
|
# File 'lib/country_currency/code.rb', line 63
def inherited(code) super
@@codes << code.instance if self == CountryCurrency::Code
end
|
Instance Method Details
#alpha2 ⇒ Object
16
17
18
|
# File 'lib/country_currency/code.rb', line 16
def alpha2
self.class.alpha2
end
|
#alpha3 ⇒ Object
20
21
22
|
# File 'lib/country_currency/code.rb', line 20
def alpha3
self.class.alpha3
end
|
#calling ⇒ Object
24
25
26
|
# File 'lib/country_currency/code.rb', line 24
def calling
self.class.calling
end
|
#calling_code ⇒ Object
28
29
30
|
# File 'lib/country_currency/code.rb', line 28
def calling_code
self.class.calling_code
end
|
#continent ⇒ Object
32
33
34
|
# File 'lib/country_currency/code.rb', line 32
def continent
self.class.continent
end
|
#currencies ⇒ Object
44
45
46
|
# File 'lib/country_currency/code.rb', line 44
def currencies
self.class.currencies
end
|
#currency ⇒ Object
40
41
42
|
# File 'lib/country_currency/code.rb', line 40
def currency
self.class.currency
end
|
#currency_symbol ⇒ Object
48
49
50
|
# File 'lib/country_currency/code.rb', line 48
def currency_symbol
self.class.currency_symbol
end
|
#iban ⇒ Object
52
53
54
|
# File 'lib/country_currency/code.rb', line 52
def iban
self.class.iban
end
|
#main_currency ⇒ Object
36
37
38
|
# File 'lib/country_currency/code.rb', line 36
def main_currency
self.class.main_currency
end
|
#name ⇒ Object
7
8
9
|
# File 'lib/country_currency/code.rb', line 7
def name
self.class.name
end
|
#numeric ⇒ Object
Also known as:
code
11
12
13
|
# File 'lib/country_currency/code.rb', line 11
def numeric
self.class.numeric
end
|