rubill 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f96a5cd060d28c4392edf23dc9c628a63d1d860c
4
- data.tar.gz: 23030225af499e6ef66a6697f5e63d38a99dba9c
3
+ metadata.gz: 800f1ce2d88c431b7067624e850027a3ee681964
4
+ data.tar.gz: 51e152179e7eb31720e45e563757fedfb95c9b4f
5
5
  SHA512:
6
- metadata.gz: fc8c0601f8b9b4e832e79fe751a0f7dd6028b295931242722f36b8be839da2c9ead9bf14cfb4799fb633778cd79f612706251320b63e9756c30077785a876446
7
- data.tar.gz: 6313e9208df792a06532ce0fd718d0722151d21a529a377d1cbfcc39797e2c19b93ada6eceb6c8137e618dbf4fc196573b05e17b227e57c8294bda3313b3b6c7
6
+ metadata.gz: 4dc012e662f35eaab3858451c1d0d6e8a86ed312e6f11fb5f4c8d16afb62af29daef566ae12163717c774a08c7c2156441abd7bd0d1a01295f2b29815b838161
7
+ data.tar.gz: b9468482e3a9e7d979de98f9b6d6f8a798aec35d7f40533a39acd6c57ab9e604f486a74e598fc3cc803e14ec797a3d1e785b59058db4a8798997fb1c09f3311e
@@ -49,9 +49,10 @@ module Rubill
49
49
  end
50
50
 
51
51
  def self.find_by_name(name)
52
- raw_result = Query.list(remote_class_name, 0, 1, [Query::Filter.new("name", "=", name)])
52
+ filter = Query::Filter.new("name", "=", name)
53
+ raw_result = Query.list(remote_class_name, 0, 1, [filter])
53
54
 
54
- new(raw_result.first)
55
+ raw_result.length > 0 ? new(raw_result.first) : nil
55
56
  end
56
57
 
57
58
  def self.where(filters=[])
@@ -1,3 +1,3 @@
1
1
  module Rubill
2
- class ActgClass; end
2
+ class ActgClass < Base; end
3
3
  end
@@ -1,5 +1,19 @@
1
1
  module Rubill
2
2
  class Customer < Base
3
+ # The Bill.com API does not currently support searching by email or
4
+ # account number. Be careful as ::find_by_email will load all active
5
+ # Customers into memory
6
+ def self.find_by_email(email)
7
+ active.find { |customer| customer[:email] == email }
8
+ end
9
+
10
+ # The Bill.com API does not currently support searching by email or
11
+ # account number. Be careful as ::find_by_account_number will load all
12
+ # active Customers into memory
13
+ def self.find_by_account_number(account_number)
14
+ active.find { |customer| customer[:accNumber] == account_number.to_s }
15
+ end
16
+
3
17
  def contacts
4
18
  CustomerContact.active_by_customer(id)
5
19
  end
@@ -1,3 +1,3 @@
1
1
  module Rubill
2
- class Location; end
2
+ class Location < Base; end
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Taber
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.5.1
112
+ rubygems_version: 2.6.11
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Interface with Bill.com