class PipedriveJetrockets::PersonService
Constants
- HOST
Public Class Methods
new(resource_name)
click to toggle source
# File lib/pipedrive_jetrockets/person_service.rb, line 5 def initialize(resource_name) @resource_name = resource_name end
Public Instance Methods
find_by_email(email)
click to toggle source
# File lib/pipedrive_jetrockets/person_service.rb, line 9 def find_by_email(email) uri = build_uri({term: email, search_by_email: true }, 'find') response = HTTP.get(uri) case response.code when 200 json_array = ::JSON.parse(response)['data'] return [] unless json_array json_array.map{|raw|build_entity(raw)} else raise PipedriveJetrockets::Error.new(response.code) end rescue HTTP::ConnectionError raise PipedriveJetrockets::Error.new(408) end