Class: Harvesting::Models::ProjectTaskAssignment

Inherits:
HarvestRecord show all
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

#attributes, #harvest_client

Instance Method Summary collapse

Methods inherited from HarvestRecord

#create, #save, #update

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

#pathObject



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_hashObject

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