Class: PipeDrive::Person

Inherits:
ResourceBase show all
Defined in:
lib/pipe_drive/person.rb

Constant Summary collapse

ALLOW_FOR_SEARCH_TERMS =
%i[name email]
ALLOW_FOR_ADDITION_SEARCH_OPTS =
%i[org_id start limit]

Instance Method Summary collapse

Methods inherited from ResourceBase

field_keys, find_by, list, pagination_list, resource_name, search

Methods inherited from Base

create, delete, #delete, find_by_id, #initialize, #parameterize, parameterize, requester, #requester, search_and_setup_by, #update, update

Constructor Details

This class inherits a constructor from PipeDrive::Base

Instance Method Details

#activities(start_from = 0, per_page = DEFAULT_PER_PAGE, options = {}, &block) ⇒ Object



6
7
8
9
10
11
# File 'lib/pipe_drive/person.rb', line 6

def activities(start_from=0, per_page=DEFAULT_PER_PAGE, options={}, &block)
  path = "/persons/#{id}/activities"
  params = {start: start_from, limit: per_page}
  params.merge!(options)
  pagination(path, params, &block)
end

#deals(start_from = 0, per_page = DEFAULT_PER_PAGE, options = {}, &block) ⇒ Object



13
14
15
16
17
18
# File 'lib/pipe_drive/person.rb', line 13

def deals(start_from=0, per_page=DEFAULT_PER_PAGE, options={}, &block)
  path = "/persons/#{id}/deals"
  params = {start: start_from, limit: per_page}
  params.merge!(options)
  pagination(path, params, &block)
end