rubill 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/rubill/base.rb +3 -2
 - data/lib/rubill/entities/actg_class.rb +1 -1
 - data/lib/rubill/entities/customer.rb +14 -0
 - data/lib/rubill/entities/location.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 800f1ce2d88c431b7067624e850027a3ee681964
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 51e152179e7eb31720e45e563757fedfb95c9b4f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 4dc012e662f35eaab3858451c1d0d6e8a86ed312e6f11fb5f4c8d16afb62af29daef566ae12163717c774a08c7c2156441abd7bd0d1a01295f2b29815b838161
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b9468482e3a9e7d979de98f9b6d6f8a798aec35d7f40533a39acd6c57ab9e604f486a74e598fc3cc803e14ec797a3d1e785b59058db4a8798997fb1c09f3311e
         
     | 
    
        data/lib/rubill/base.rb
    CHANGED
    
    | 
         @@ -49,9 +49,10 @@ module Rubill 
     | 
|
| 
       49 
49 
     | 
    
         
             
                end
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
                def self.find_by_name(name)
         
     | 
| 
       52 
     | 
    
         
            -
                   
     | 
| 
      
 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,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
         
     | 
    
        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. 
     | 
| 
      
 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. 
     | 
| 
      
 112 
     | 
    
         
            +
            rubygems_version: 2.6.11
         
     | 
| 
       113 
113 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       114 
114 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       115 
115 
     | 
    
         
             
            summary: Interface with Bill.com
         
     |