Class: Harvesting::Models::ProjectTaskAssignment
- Inherits:
-
HarvestRecord
- Object
- Base
- HarvestRecord
- Harvesting::Models::ProjectTaskAssignment
- Defined in:
- lib/harvesting/models/project_task_assignment.rb
Overview
A task assignment record from your Harvest account.
For more information: help.getharvest.com/api-v2/projects-api/projects/task-assignments/
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #path ⇒ Object
-
#to_hash ⇒ Object
def project_id # TODO: handle case where project’s id is part of json object @attributes end.
Methods inherited from HarvestRecord
Methods inherited from Base
#create, #delete, #fetch, get, #initialize, #save, #update
Constructor Details
This class inherits a constructor from Harvesting::Models::Base
Instance Method Details
#path ⇒ Object
18 19 20 21 |
# File 'lib/harvesting/models/project_task_assignment.rb', line 18 def path base_url = "projects/#{project.id}/task_assignments" id.nil? ? base_url : "#{base_url}/#{id}" end |
#to_hash ⇒ Object
def project_id
# TODO: handle case where project's id is part of json object
@attributes["project_id"]
end
28 29 30 |
# File 'lib/harvesting/models/project_task_assignment.rb', line 28 def to_hash { project_id: project.id, task_id: task.id }.merge(super) end |