Class: Contactually::Accounts

Inherits:
Object
  • Object
show all
Defined in:
lib/contactually/accounts.rb

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Accounts

Returns a new instance of Accounts.



4
5
6
# File 'lib/contactually/accounts.rb', line 4

def initialize(master)
  @master = master
end

Instance Method Details

#destroy(id, params = {}) ⇒ Object



18
19
20
# File 'lib/contactually/accounts.rb', line 18

def destroy(id, params = {})
  @master.call("accounts/#{id}.json", :delete, params)
end

#index(params = {}) ⇒ Object



8
9
10
11
# File 'lib/contactually/accounts.rb', line 8

def index(params = {})
  hash = @master.call('accounts.json', :get, params)
  Contactually::Utils.accounts_hash_to_objects(hash)
end

#show(id, params = {}) ⇒ Object



13
14
15
16
# File 'lib/contactually/accounts.rb', line 13

def show(id, params = {})
  hash = @master.call("accounts/#{id}.json", :get, params)
  Contactually::Utils.(hash)
end