Class: Pipedrive::Deals

Inherits:
Base
  • Object
show all
Defined in:
lib/pipedrive/deals.rb

Instance Method Summary collapse

Methods inherited from Base

#[], #all, #authenticate, #base_uri, #get, #initialize, #metric_key, #metrics, #protocol, #resource, #resource_path

Constructor Details

This class inherits a constructor from Pipedrive::Base

Instance Method Details

#prepare_options(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/pipedrive/deals.rb', line 3

def prepare_options(options = {})
  filter_name = options.delete(:filter)
  if filter_name.present?
    filter = resource(:filters)[filter_name]
    if filter.present?
      options[:params] = (options[:params]||{}).merge({filter_id: filter[:id]})
    end
  end

  options
end