Class: NimbleApi::Contacts

Inherits:
Object
  • Object
show all
Defined in:
lib/nimble/contacts.rb

Instance Method Summary collapse

Constructor Details

#initialize(nimble) ⇒ Contacts

Returns a new instance of Contacts.



5
6
7
# File 'lib/nimble/contacts.rb', line 5

def initialize(nimble)
  @nimble = nimble
end

Instance Method Details

#list(params = {}) ⇒ Object

Returns list of contacts. Limits contacts and fields with params if provided



10
11
12
13
14
# File 'lib/nimble/contacts.rb', line 10

def list params={}
  params[:fields] = params[:fields].join(',') if params[:fields]
  params[:record_type] ||= 'person'
  @nimble.get "contacts", params
end

#list_ids(params = {}) ⇒ Object

Returns list of contacts ids only. Limits contacts with params if provided



17
18
19
# File 'lib/nimble/contacts.rb', line 17

def list_ids params={}
  @nimble.get "contacts/ids", params
end