A Ruby gem for manipulating JP postal codes.
Switch branches/tags
Clone or download
Latest commit 10fa9bb Feb 2, 2017
Permalink
Failed to load latest commit information.
data 最新化 Feb 1, 2017
lib update version Feb 2, 2017
spec fixed spec Feb 2, 2017
vendor create vendor dir Jul 3, 2013
.gitignore Ignore .DS_Store Feb 1, 2017
Gemfile first commit Jul 3, 2013
LICENSE.txt first commit Jul 3, 2013
README.md Update README.md Sep 16, 2014
Rakefile
zip_code_jp.gemspec zip url scraping Sep 14, 2015

README.md

ZipCodeJp

A Ruby gem for manipulating JP postal codes.

Installation

Add this line to your application's Gemfile:

gem 'zip_code_jp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install zip_code_jp

Usage

address = ZipCodeJp.find '102-0072'
address.prefecture      # 東京都
address.prefecture_kana # トウキョウト
address.prefecture_code # 13
address.city            # 千代田区
address.city_kana       # チヨダク
address.town            # 飯田橋
address.town_kana       # イイダバシ
address.zip_code        # 1020072

If more than one address corresponds

addresses = ZipCodeJp.find '0790177'
addresses.class # Array
addresses.each do |address|
  address.zip_code # 0790177
end

Update the JSON data of postal code

ZipCodeJp.export_json

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request