Build Status Coverage Status Gem Version

ExternalApiService

Installation

Add this line to your application's Gemfile:

gem 'external_api_service'

And then execute:

$ bundle

Or install it yourself as:

$ gem install external_api_service

Usage

To use, you need to require the service module wherever you are wanting to use it:

require 

To make a GET request, you need an endpoint (required), and any query params in a Hash (optional). The endpoint must return JSON. It will work with HTTPS or HTTP. Call get_service:

# no params
url = 

get_service will transform the JSON to Ruby Hash with symbolized names:

# First entry from the Chicago Problem Landlord List in Array of Hashes (“https://data.cityofchicago.org/Buildings/Problem-Landlord-List-Map/dip3-ud6z”)

[{:respondent=>

Features To-Do

Does not support JSONP.

Only makes GET requests. Probably need to update to make POST requests as well.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/external_api_service/fork )
  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 a new Pull Request