class CountryCurrency::Code
Attributes
alpha2[RW]
alpha3[RW]
calling[RW]
calling_code[RW]
continent[RW]
currencies[W]
currency[RW]
currency_symbol[RW]
iban[W]
main_currency[RW]
name[RW]
numeric[RW]
Public Class Methods
all()
click to toggle source
# File lib/country_currency/code.rb, line 68 def all @@codes.uniq end
currencies()
click to toggle source
# File lib/country_currency/code.rb, line 76 def currencies if defined? @currencies return @currencies else return [@main_currency] end end
for_select(type = :alpha2)
click to toggle source
# File lib/country_currency/code.rb, line 72 def for_select(type = :alpha2) all.map { |country| [country.name, country.send(type)] } end
iban()
click to toggle source
# File lib/country_currency/code.rb, line 84 def iban # Return `nil` if the country doesn't use IBANs return @iban if defined? @iban end
Public Instance Methods
alpha2()
click to toggle source
# File lib/country_currency/code.rb, line 16 def alpha2 self.class.alpha2 end
alpha3()
click to toggle source
# File lib/country_currency/code.rb, line 20 def alpha3 self.class.alpha3 end
calling()
click to toggle source
# File lib/country_currency/code.rb, line 24 def calling self.class.calling end
calling_code()
click to toggle source
# File lib/country_currency/code.rb, line 28 def calling_code self.class.calling_code end
continent()
click to toggle source
# File lib/country_currency/code.rb, line 32 def continent self.class.continent end
currencies()
click to toggle source
# File lib/country_currency/code.rb, line 44 def currencies self.class.currencies end
currency()
click to toggle source
# File lib/country_currency/code.rb, line 40 def currency self.class.currency end
currency_symbol()
click to toggle source
# File lib/country_currency/code.rb, line 48 def currency_symbol self.class.currency_symbol end
iban()
click to toggle source
# File lib/country_currency/code.rb, line 52 def iban self.class.iban end
main_currency()
click to toggle source
# File lib/country_currency/code.rb, line 36 def main_currency self.class.main_currency end
name()
click to toggle source
# File lib/country_currency/code.rb, line 7 def name self.class.name end
numeric()
click to toggle source
# File lib/country_currency/code.rb, line 11 def numeric self.class.numeric end
Also aliased as: code