Class: Pipedrive::Filters

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

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

This class inherits a constructor from Pipedrive::Base

Instance Method Details

#[](name_key) ⇒ Object



16
17
18
19
# File 'lib/pipedrive/filters.rb', line 16

def [](name_key)
  name = name_key.to_s.humanize
  get.select{|filter| filter['name'] == name}.first
end

#for_type(type, options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/pipedrive/filters.rb', line 9

def for_type(type, options = {})
  type = type.to_sym
  type = :org if type == :organizations

  get (options || {}).merge!({params: {type: type}})
end