Project

crunch-api

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby interface to the Crunch Accounting 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
>= 0
~> 2.4

Runtime

~> 1.5.9
~> 2.2.0
~> 0.4.7
 Project Readme

Crunch::Api

Gem Version Build Status

A Ruby interface to the Crunch Accounting API

Installation

Add this line to your application's Gemfile:

gem 'crunch-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install crunch-api

Quick Start Guide

Hurry up and show me how to call the service already...

First you need to register your application with Crunch Accounting using OAuth

Next require the gem:

require 'crunch-api'

Then, copy and paste your OAuth credentials into the configuration:

CrunchApi.configure do |config|
  config.consumer_key = YOUR_CONSUMER_KEY
  config.consumer_secret = YOUR_CONSUMER_SECRET
  config.oauth_token = YOUR_OAUTH_TOKEN
  config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end

And there you go, you're all set to access some Crunchy goodness

CrunchApi::Supplier.for_id(123)

For more examples of how to use this gem, see the Usage Examples below

Usage Examples

All examples require OAuth configuration to be set in order to authenticate

Get all suppliers

CrunchApi::Supplier.all

Get a specific supplier

CrunchApi::Supplier.for_id(123)

Create a new supplier

CrunchApi::Supplier.create(name: 'Test Supplier')

Update an existing supplier

# using a hash of attributes
CrunchApi::Supplier.update(123, name: 'Test Supplier')

# using an existing supplier
supplier = CrunchApi::Supplier.for_id(123)

CrunchApi::Supplier.update(1, supplier)

Delete a supplier

CrunchApi::Supplier.delete(123)

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