Module: ISO3166

Defined in:
lib/countries/country.rb,
lib/countries/mongoid.rb

Defined Under Namespace

Classes: Country

Class Method Summary collapse

Class Method Details

.Country(country_data_or_country) ⇒ Object



181
182
183
184
185
186
187
188
189
190
# File 'lib/countries/country.rb', line 181

def ISO3166::Country(country_data_or_country)
  case country_data_or_country
  when ISO3166::Country
    country_data_or_country
  when String, Symbol
    ISO3166::Country.search(country_data_or_country)
  else
    fail TypeError, "can't convert #{country_data_or_country.class.name} into ISO3166::Country"
  end
end