/zaim

zaim-ruby gem

Primary LanguageRubyMIT LicenseMIT

The Zaim Ruby Gem

Build Status Coverage Status

A Ruby interface to the Zaim API.

Installation

Add this line to your application's Gemfile:

gem 'zaim-ruby', require: 'zaim'

And then execute:

$ bundle install --path vendor/bundle

Or install it yourself as:

$ gem install zaim-ruby

Quick Start Guide

Register your application with Zaim Developers Center.

Zaim.configure do |config|
  config.consumer_key = YOUR_CONSUMER_KEY
  config.consumer_secret = YOUR_CONSUMER_SECRET
end

Instantiate a Zaim::Client for each user's access

client = Zaim::Client.new(
  oauth_token: "Client's access token",
  oauth_token_secret: "Client's access secret"
)

You can make requests as the authenticated user

client.user_verify

Usage Examples

Initialize

Zaim.configure do |config|
  config.consumer_key = YOUR_CONSUMER_KEY
  config.consumer_secret = YOUR_CONSUMER_SECRET
end

client = Zaim::Client.new(
  oauth_token: YOUR_OAUTH_TOKEN,
  oauth_token_secret: YOUR_OAUTH_SECRET
)

Fetch the requesting user's information

client.user_verify # => alias: current_user

Fetch the list of input money data

client.money_get # => alias: money

Fetch the list of requesting user's categories

client.category_home_get # => alias: categories

Fetch the list of system default categories

client.category_get # => alias: default_categories

Fetch the list of requesting user's genres

client.genre_home_get # => alias: genres

Fetch the list of system default genres

client.genre_get # => alias: default_genres

Fetch the list of requesting user's accounts

client.account_home_get # => alias: accounts

Fetch the list of system default accounts

client.account_get # => alias: default_accounts

Fetch the list of available currencies

client.currency_get # => alias: currencies

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