Class: Taleo::Activity

Inherits:
Resource show all
Defined in:
lib/taleo/activity.rb

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, #relationship_urls

Constructor Details

This class inherits a constructor from Taleo::Resource

Instance Method Details

#can_download?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/taleo/activity.rb', line 18

def can_download?
  relationship_urls.key?('formDownloadUrl')
end

#downloadObject



22
23
24
25
26
27
28
# File 'lib/taleo/activity.rb', line 22

def download
  unless can_download?
    raise Error.new("Activity #{id} is not available for download")
  end

  client.download(relationship_urls.fetch('formDownloadUrl'))
end

#employee_idObject



14
15
16
# File 'lib/taleo/activity.rb', line 14

def employee_id
  data.fetch('activityEmployee')
end

#idObject



10
11
12
# File 'lib/taleo/activity.rb', line 10

def id
  data.fetch('id')
end