class PipeDrive::OverallSourceBase

Public Class Methods

list(options={}) { |resource| ... } click to toggle source
# File lib/pipe_drive/overall_source_base.rb, line 14
def list(options={}, &block)
  path = "/#{resource_name}s"
  resources = requester.http_get(path, options) do |result|
    result[:data].nil? ? [] : list_objects(result)
  end
  resources.each do |resource|
    yield resource
  end if block_given?
  resources
end

Public Instance Methods

deals(start_from=0, per_page=DEFAULT_PER_PAGE, options={}, &block) click to toggle source
# File lib/pipe_drive/overall_source_base.rb, line 4
def deals(start_from=0, per_page=DEFAULT_PER_PAGE, options={}, &block)
  path = "/#{resource_name}s/#{id}/deals"
  params = {start: start_from, limit: per_page}
  params.merge!(options)
  pagination(path, params, &block)
end