Module: IPay::Countries

Defined in:
lib/ipay/constants.rb

Constant Summary collapse

@@countries =
YAML.load_file(File.join(File.dirname(__FILE__), 'countries.yml'))

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



7
8
9
10
# File 'lib/ipay/constants.rb', line 7

def self.[](key)
  key = key.to_s.downcase.to_sym
  @@countries[key]
end

.country_code(key) ⇒ Object



16
17
18
# File 'lib/ipay/constants.rb', line 16

def self.country_code(key)
  @@countries[key][:country_code] rescue nil
end

.currency_code(key) ⇒ Object



12
13
14
# File 'lib/ipay/constants.rb', line 12

def self.currency_code(key)
  @@countries[key][:currency_code] rescue nil
end