ISO 3166-2 is part of the ISO 3166 standard published by the International Organization for Standardization (ISO), and defines codes for identifying the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1.
ISO3166P2 provides a wrapper to fetch ISO-3166-2 data. It depends on data provided by https://github.com/fran-diaz/ISO-3166.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install ISO3166P2
###Getting all Regions
all_regions = ISO3166P2::Regions.new.all p all_regions.size # => 5077
- Fork it ( https://github.com/vipulnsward/ISO3166P2/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request