class Rubill::Customer
Public Class Methods
find_by_account_number(account_number)
click to toggle source
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
# 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)
click to toggle source
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
# File lib/rubill/entities/customer.rb, line 6 def self.find_by_email(email) active.find { |customer| customer[:email] == email } end
Public Instance Methods
contacts()
click to toggle source
# File lib/rubill/entities/customer.rb, line 17 def contacts CustomerContact.active_by_customer(id) end