Class: Taleo::Employee

Inherits:
Resource show all
Defined in:
lib/taleo/packet.rb,
lib/taleo/activity.rb,
lib/taleo/employee.rb,
lib/taleo/candidate.rb

Overview

Stub Employee class

Instance Attribute Summary

Attributes inherited from Resource

#client, #data

Instance Method Summary collapse

Methods inherited from Resource

has_many, has_one, #initialize, #related_resource, #related_resources

Constructor Details

This class inherits a constructor from Taleo::Resource

Instance Method Details

#first_nameObject



17
18
19
# File 'lib/taleo/employee.rb', line 17

def first_name
  data.fetch('firstName')
end

#has_attachments?Boolean

Override since employee relationship URLs will not include an attachments URL

Returns:

  • (Boolean)


40
41
42
# File 'lib/taleo/employee.rb', line 40

def has_attachments?
  true
end

#idObject



13
14
15
# File 'lib/taleo/employee.rb', line 13

def id
  data.fetch('employeeId')
end

#last_nameObject



21
22
23
# File 'lib/taleo/employee.rb', line 21

def last_name
  data.fetch('lastName')
end

#location_idObject



25
26
27
# File 'lib/taleo/employee.rb', line 25

def location_id
  data.fetch('location')
end

#relationship_urlsObject

Annoying hack since the employee resource relationship URLs hash doesn’t include an attachments link, even if there are attachments.



46
47
48
49
50
51
# File 'lib/taleo/employee.rb', line 46

def relationship_urls
  urls = super
  urls.merge({
    'attachment' => urls.fetch('historylog').gsub(/historylog$/, 'attachment')
  })
end

#ssnObject



29
30
31
# File 'lib/taleo/employee.rb', line 29

def ssn
  data.fetch('ssn')
end