Class: Harvesting::Models::Project
- Inherits:
-
HarvestRecord
- Object
- Base
- HarvestRecord
- Harvesting::Models::Project
- Defined in:
- lib/harvesting/models/project.rb
Overview
A project record from your Harvest account.
For more information: help.getharvest.com/api-v2/projects-api/projects/projects/
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #path ⇒ Object
-
#task_assignments ⇒ Object
Provides access to the task assignments that are associated with this project.
- #time_entries ⇒ Object
- #to_hash ⇒ Object
-
#user_assignments ⇒ Object
Provides access to the user assignments that are associated with this project.
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
33 34 35 |
# File 'lib/harvesting/models/project.rb', line 33 def path @attributes['id'].nil? ? "projects" : "projects/#{@attributes['id']}" end |
#task_assignments ⇒ Object
Provides access to the task assignments that are associated with this project.
53 54 55 |
# File 'lib/harvesting/models/project.rb', line 53 def task_assignments harvest_client.task_assignments(project_id: self.id) end |
#time_entries ⇒ Object
41 42 43 |
# File 'lib/harvesting/models/project.rb', line 41 def time_entries harvest_client.time_entries(project_id: self.id) end |
#to_hash ⇒ Object
37 38 39 |
# File 'lib/harvesting/models/project.rb', line 37 def to_hash { client_id: client.id }.merge(super) end |
#user_assignments ⇒ Object
Provides access to the user assignments that are associated with this project.
47 48 49 |
# File 'lib/harvesting/models/project.rb', line 47 def user_assignments harvest_client.user_assignments(project_id: self.id) end |