Skip to content

Commit

Permalink
Merge pull request #18 from Chebotarev/update-entities
Browse files Browse the repository at this point in the history
Update entities
  • Loading branch information
ataber authored May 18, 2017
2 parents cdeff3b + 6cceaae commit c08a36a
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 48 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
PATH
remote: .
specs:
rubill (0.1.6)
rubill (0.1.7)
json
rest-client

GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
domain_name (0.5.20160615)
domain_name (0.5.20161021)
unf (>= 0.0.5, < 1.0.0)
http-cookie (1.0.2)
http-cookie (1.0.3)
domain_name (~> 0.5)
json (2.0.1)
json (2.0.3)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
[![Build Status](https://travis-ci.org/ataber/rubill.svg?branch=master)](https://travis-ci.org/ataber/rubill)
[![Code Climate](https://codeclimate.com/github/ataber/rubill/badges/gpa.svg)](https://codeclimate.com/github/ataber/rubill)

rubill
======
# rubill

Ruby interface to Bill.com's API

Bill.com's own documentation: http://developer.bill.com/api-documentation/overview/
Bill.com's developer documentation: https://developer.bill.com/hc/en-us/categories/201195646

======

Setup:
## Setup:

```
Rubill.configure do |config|
Expand All @@ -21,16 +18,31 @@ Rubill.configure do |config|
end
```

======

Usage:

Rubill exposes the following entities directly: Customer, Customer Contact, Bill, Chart of Account, ReceivedPayment, SentPayment, Vendor, and Invoice.
## Usage:

Rubill exposes the following entities directly:

* ActgClass
* Attachment
* Bill
* BillPayment
* ChartOfAccount
* Customer
* CustomerContact
* GetCheckImageData
* GetDisbursementData
* Invoice
* Item
* Location
* ReceivedPayment
* SentBillPayment
* SentPayment
* Vendor

For each you can sync a hash-like record with Bill.com by calling for example

```
Rubill::Customer.create(attrs)
```

The resulting return value will be a Rubill::Customer object, which you can update by modifying via hash assignment and then calling `save`. Note that this flow does not work for ReceivedPayments or SentPayments, as you will need to void and then recreate these records.
The resulting return value will be a `Rubill::Customer` object, which you can update by modifying via hash assignment and then calling `save`. Note that this flow does not work for ReceivedPayments or SentPayments, as you will need to void and then recreate these records.
20 changes: 4 additions & 16 deletions lib/rubill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,8 @@ def sandbox
end
end

require "rubill/session"
require "rubill/query"
require "rubill/base"
require "rubill/bill"
require "rubill/bill_payment"
require "rubill/chart_of_account"
require "rubill/invoice"
require "rubill/attachment"
require "rubill/sent_payment"
require "rubill/sent_bill_payment"
require "rubill/received_payment"
require "rubill/vendor"
require "rubill/customer"
require "rubill/customer_contact"
require "rubill/attachment"
require "rubill/get_disbursement_data"
require "rubill/get_check_image_data"
require "rubill/query"
require "rubill/session"

Dir["#{File.dirname(__FILE__)}/rubill/entities/*.rb"].each { |f| require f }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions lib/rubill/customer.rb → lib/rubill/entities/customer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module Rubill
class Customer < Base
def self.find_by_name(name)
where([Query::Filter.new("name", "=", name)]).first
end

def contacts
CustomerContact.active_by_customer(id)
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lib/rubill/entities/item.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Rubill
class Item < Base; end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 14 additions & 11 deletions rubill.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'rubill'
s.version = '0.1.6'
s.version = '0.1.7'
s.date = '2014-09-31'
s.summary = "Interface with Bill.com"
s.description = "A Ruby interface to Bill.com's API"
Expand All @@ -11,16 +11,19 @@ Gem::Specification.new do |s|
"lib/rubill/session.rb",
"lib/rubill/query.rb",
"lib/rubill/base.rb",
"lib/rubill/bill.rb",
"lib/rubill/bill_payment.rb",
"lib/rubill/invoice.rb",
"lib/rubill/sent_payment.rb",
"lib/rubill/sent_bill_payment.rb",
"lib/rubill/received_payment.rb",
"lib/rubill/vendor.rb",
"lib/rubill/customer.rb",
"lib/rubill/customer_contact.rb",
"lib/rubill/attachment.rb",
"lib/rubill/entities/bill.rb",
"lib/rubill/entities/bill_payment.rb",
"lib/rubill/entities/invoice.rb",
"lib/rubill/entities/sent_payment.rb",
"lib/rubill/entities/sent_bill_payment.rb",
"lib/rubill/entities/received_payment.rb",
"lib/rubill/entities/vendor.rb",
"lib/rubill/entities/customer.rb",
"lib/rubill/entities/customer_contact.rb",
"lib/rubill/entities/attachment.rb",
"lib/rubill/entities/location.rb",
"lib/rubill/entities/actg_class.rb",
"lib/rubill/entities/item.rb",
]
s.homepage = 'http://rubygems.org/gems/rubill'
s.license = 'MIT'
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@

RSpec.configure do |c|
end

0 comments on commit c08a36a

Please sign in to comment.