ISO3166P2
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.
Installation
Add this line to your application's Gemfile:
gem 'ISO3166P2'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ISO3166P2
Usage
###Getting all Regions
all_regions = ISO3166P2::Regions.new.all
p all_regions.size
# => 5077
Contributing
- 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