Skip to content

emsk/resas_kit

Repository files navigation

ResasKit

Gem Version Build Status Build Status Build status Build Status Codecov Code Climate Inline docs License

Ruby wrapper for the RESAS API.

Installation

Add this line to your application's Gemfile:

gem 'resas_kit'

And then execute:

$ bundle

Or install it yourself as:

$ gem install resas_kit

Usage

require 'resas_kit'

client = ResasKit::Client.new(api_key: '1234567890ABCDEFGHIJ1234567890abcdefghij')

response = client.get('prefectures')
response.body # get body
response.headers # get headers
response.status # get status

client.get('tourism/foreigners/forFrom', year: 2016, pref_code: '32', purpose: 2, add_area: '31,33') # underscored key
client.get('tourism/foreigners/forFrom', year: 2016, prefCode: '32', purpose: 2, addArea: '31,33') # camelized key
client.get_tourism__foreigners__for_from(year: 2016, pref_code: '32', purpose: 2, add_area: '31,33') # ghost method

client.get('prefectures').body.result[0].pref_name # method chaining

ENV

ENV Variable Description
RESAS_API_KEY Your RESAS API KEY
RESAS_API_VERSION Target RESAS API VERSION

You can create instance more easily.

client = ResasKit::Client.new

Supported RESAS API Version

ResasKit supports RESAS API v1.

ResasKit's API documentation is here.

Supported Ruby Versions

Ruby 2.0.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7

Contributing

  1. Fork it ( https://github.com/emsk/resas_kit/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

License

MIT