0.0
No commit activity in last 3 years
No release in over 3 years
API wrapper for postcodeapi.nu zipcode api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 2.1.0
>= 0
~> 2.13.0
~> 2.4.0
~> 1.8.0

Runtime

 Project Readme

Postcodeapi

Build Status Code Climate Gem Version

API wrapper for postcodeapi.nu zipcode api.

Installation

Add this line to your application's Gemfile:

gem 'ww-postcodeapi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ww-postcodeapi

Setup

Add file config/initializers/postcodeapi.rb.

require 'postcodeapi'
Postcodeapi.configure do |config|
  config.api_key = "1234567890abcdefghizjklmnopqrstuvwxyz"
end

Example usage

Get an address for a zipcode:

response = Postcodeapi.get_street("5041EB")
# => #<OpenStruct street="Wilhelminapark", postcode="5041EB", town="Tilburg", latitude=51.9401, longitude=5.61531, x=133505, y=397537>

You can then use:

response.street
# => "Wilhelminapark"
response.town
# => "Tilburg"

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