Class: Uncomtrade::Helpers::Country

Inherits:
Object
  • Object
show all
Defined in:
lib/uncomtrade/helpers/country.rb

Class Method Summary collapse

Class Method Details

.iso_code(nation) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/uncomtrade/helpers/country.rb', line 9

def self.iso_code(nation)
  if nation == 0
    0 # countries gem has no number called 0, it is comtrade api number.
  elsif nation == "all"
    "all"
  else
    find_country(nation)
  end
end