Module: ISO3166
- Defined in:
- lib/countries/data.rb,
lib/countries/setup.rb,
lib/countries/country.rb,
lib/countries/mongoid.rb
Defined Under Namespace
Classes: Country, Data, Setup
Class Method Summary
collapse
Class Method Details
.Country(country_data_or_country) ⇒ Object
188
189
190
191
192
193
194
195
196
197
|
# File 'lib/countries/country.rb', line 188
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
|