Class: Kaui::AccountEmail

Inherits:
KillBillClient::Model::AccountEmailAttributes
  • Object
show all
Defined in:
app/models/kaui/account_email.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_all_sorted_by_account_id(account_id, audit = 'NONE', options = {}) ⇒ Object



3
4
5
6
# File 'app/models/kaui/account_email.rb', line 3

def self.(, audit = 'NONE', options = {})
  emails = Kaui::Account.new(:account_id => ).emails(audit, options)
  emails.map { |email| Kaui::AccountEmail.new(email.to_hash) }.sort
end

Instance Method Details

#<=>(account_email) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'app/models/kaui/account_email.rb', line 18

def <=>()
  if .nil?
    -1
  elsif .email.nil?
    email.nil? ? 0 : 1
  else
    email.to_s <=> .email.to_s
  end
end

#create(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object



8
9
10
11
# File 'app/models/kaui/account_email.rb', line 8

def create(user = nil, reason = nil, comment = nil, options = {})
   = Kaui::Account.new(:account_id => )
  .add_email(email, user, reason, comment, options)
end

#destroy(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object



13
14
15
16
# File 'app/models/kaui/account_email.rb', line 13

def destroy(user = nil, reason = nil, comment = nil, options = {})
   = Kaui::Account.new(:account_id => )
  .remove_email(email, user, reason, comment, options)
end