Class: Rubill::Customer
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.find_by_account_number(account_number) ⇒ Object
The Bill.com API does not currently support searching by email or account number.
-
.find_by_email(email) ⇒ Object
The Bill.com API does not currently support searching by email or account number.
Instance Method Summary collapse
Methods inherited from Base
#[], #[]=, active, all, create, delete, #delete, find, find_by_name, #id, #initialize, #save, update, where
Constructor Details
This class inherits a constructor from Rubill::Base
Class Method Details
.find_by_account_number(account_number) ⇒ Object
The Bill.com API does not currently support searching by email or account number. Be careful as ::find_by_account_number will load all active Customers into memory
13 14 15 |
# File 'lib/rubill/entities/customer.rb', line 13 def self.find_by_account_number(account_number) active.find { |customer| customer[:accNumber] == account_number.to_s } end |
.find_by_email(email) ⇒ Object
The Bill.com API does not currently support searching by email or account number. Be careful as ::find_by_email will load all active Customers into memory
6 7 8 |
# File 'lib/rubill/entities/customer.rb', line 6 def self.find_by_email(email) active.find { |customer| customer[:email] == email } end |
Instance Method Details
#contacts ⇒ Object
17 18 19 |
# File 'lib/rubill/entities/customer.rb', line 17 def contacts CustomerContact.active_by_customer(id) end |