Class: Harvest::API::Contacts

Inherits:
Base
  • Object
show all
Includes:
Behavior::Crud
Defined in:
lib/harvest/api/contacts.rb

Instance Attribute Summary

Attributes inherited from Base

#credentials

Instance Method Summary collapse

Methods included from Behavior::Crud

#create, #delete, #find, #update

Methods inherited from Base

api_model, #initialize

Constructor Details

This class inherits a constructor from Harvest::API::Base

Instance Method Details

#all(client_id = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/harvest/api/contacts.rb', line 8

def all(client_id = nil)
  response = if client_id
    request(:get, credentials, "/clients/#{client_id}/contacts")
  else
    request(:get, credentials, "/contacts")
  end
  
  api_model.parse(response.body)
end