Class: Pipedrive::User
- Defined in:
- lib/pipedrive/resources/user.rb
Class Method Summary collapse
-
.find(term, search_by_email) ⇒ Object
GET /v1/users/find/ Find users by their name or email.
Methods inherited from Resource
all, class_name, fields_dicc, has_many, #initialize, #initialize_from_data, inverted_fields_dicc, #no_content?, #refresh, #resource_url, resource_url, retrieve, search, #search_for_fields, search_for_fields, #update_attributes, update_method, #update_method
Methods included from APIOperations::Create
Methods included from APIOperations::Delete
Methods included from APIOperations::Update
Methods included from APIOperations::Request
Constructor Details
This class inherits a constructor from Pipedrive::Resource
Class Method Details
.find(term, search_by_email) ⇒ Object
GET /v1/users/find/ Find users by their name or email
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pipedrive/resources/user.rb', line 7 def self.find(term, search_by_email) params = { term: term } params = params.merge({ search_by_email: 1 }) if search_by_email response = request( :get, "#{resource_url}/find", params ) items = response[:data] return [] if items.nil? items.map { |d| new(d) } end |