Zip
An easy and extensible way to lookup City, State and Time Zone for a given zip code.
Installation
-
Add the dependency to your
shard.yml
:dependencies: zip: github: grkek/zip
-
Run
shards install
Usage
require "zip"
zip = Zip::Countries::UnitedStates.new
address = zip.find!("00601") # You can also use find/1 which returns a nil in case of an error
puts "State Name: #{address.state_name}"
puts "State Code: #{address.state_code}"
puts "City: #{address.city}"
puts "Time Zone: #{address.time_zone}"
Contributing
- Fork it (https://github.com/grkek/zip/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
Contributors
- Giorgi Kavrelishvili - creator and maintainer