Brapi.io Ruby Client
Ruby gem to interact with the brapi.io APIs
Installation
Add this line to your application's Gemfile:
gem 'brapi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install brapi
Usage
Initializing the client
You will need to have your account's access_token to be able to interact with the API. You also need to set an 'User-Agent' to identify your application.
access_token = 'your-access-token'
user_agent = 'Your Application Name ([email protected])'
client = Brapi::Client.new(access_token, user_agent)
Zipcodes
You can search for zipcodes by using the #zipcode
method on the client. This method will return an instance of Brapi::Zipcode
so you can use it like a plain Ruby object.
# ... Instantiate the client
client.zipcode(20061003)
=> #<Brapi::Zipcode:0x007fbbf50eb4e8
@address="Presidente Vargas",
@address_type="Avenida",
@city="Rio de Janeiro",
@city_ibge_code="3304557",
@neighborhood="Centro",
@state="RJ",
@zipcode="20071003">
Versioning
Brapi.io Ruby Client follow the Semantic Versioning.
Issues
If you have problems, please create a Github Issue.
Contributing
Please see CONTRIBUTING.md for details.
Release
Follow this steps to release a new version of the gem.
- Test if everything is running ok;
- Change version of the gem on
VERSION
constant; - Add the release date on the
CHANGELOG
; - Do a commit "Bump version x.x.x", follow the semantic version;
- Run
$ rake release
, this will send the gem to the rubygems; - Check if the gem is on the rubygems and the tags are correct on the github;
Credits
Brapi.io Ruby Client is maintained and funded by HE:labs. Thank you to all the contributors.