Class: Puree::Extractor::Person

Inherits:
Resource
  • Object
show all
Defined in:
lib/puree/extractor/person.rb

Overview

Person extractor.

Instance Method Summary collapse

Methods inherited from Resource

#get

Constructor Details

#initialize(config) ⇒ Person

Returns a new instance of Person.

Options Hash (config):

  • :url (String)

    The URL of the Pure host.

  • :username (String)

    The username of the Pure host account.

  • :password (String)

    The password of the Pure host account.



10
11
12
13
# File 'lib/puree/extractor/person.rb', line 10

def initialize(config)
  super
  setup :person
end

Instance Method Details

#find_by_id(uuid: nil, id: nil, employee_id: nil) ⇒ Puree::Model::Person

Find a person by identifier.

Parameters:

  • uuid (String) (defaults to: nil)
  • id (String) (defaults to: nil)
  • employee_id (String) (defaults to: nil)

Returns:



21
22
23
24
25
26
27
28
29
# File 'lib/puree/extractor/person.rb', line 21

def find_by_id(uuid: nil, id: nil, employee_id: nil)
  raise 'Cannot perform a request without a configuration' if @config.nil?
  @response = @request.get uuid:           uuid,
                           id:             id,
                           employee_id:    employee_id,
                           latest_api:     @latest_api,
                           resource_type:  @resource_type
  set_content @response.body
end