Improve your QuickBooks/Ruby integration experience with the quickbooks-ruby-base gem
Code from screencast and tutorial is available on Github.
Real-world to gem
I was recently able to wrap up a pattern from my QuickBooks/Ruby consulting into a gem. The gem complements and extends the quickbooks-ruby gem. Let's see how.
- First, install the gem along with
quickbooks-ruby
. - Now you need to configure the persistent locations of the Intuit OAuth connection.
- For example, if you are storing the token, secret, and company_id like this:
-
account = Account.find(1) account.qb_token account.qb_secret account.company_id
- Your config file might look like this.
- Next, I am going fire up the
rails console
to further demonstrate. - To create a
quickbooks-ruby
service takes only one line of code. - There is a
qr_model
method that generates and initializes a quickbooks-ruby model, which are long to type out by hand. - You can pass as many arguments to the model as it takes.
- Lastly, the
show
method will return a "smart" array, customers in this example. - The show method saves you from having type the following below and it is most useful for console usage.
- You can also pass the same options you would to the
quickbooks-ruby
query method e.g.
$ base.service.query.entities.map{ |e| "ID: #{e.id} DESC: #{e.display_name}" }
$ base.show(page: 1, per_page: 150)
The
show
alone method is worth installing the gem.
Contributing
I want to keep the gem light weight but I would love to see pull requests coming from your QuickBooks/Ruby integration experiences. You can see the making of this gem in this 4 part series.
- Pushed on 04/21/2014 by Christian
- QuickBooks Integration Consulting