Class: MOCO::Task
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::Task
- Defined in:
- lib/moco/entities.rb,
lib/moco/entities/task.rb
Overview
Represents a MOCO task Provides methods for task-specific associations
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#billable ⇒ Object
Returns the value of attribute billable.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
Attributes inherited from BaseEntity
Instance Method Summary collapse
- #activities ⇒ Object
-
#project ⇒ Object
Associations.
- #to_s ⇒ Object
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
60 61 62 |
# File 'lib/moco/entities.rb', line 60 def active @active end |
#billable ⇒ Object
Returns the value of attribute billable.
60 61 62 |
# File 'lib/moco/entities.rb', line 60 def billable @billable end |
#id ⇒ Object
Returns the value of attribute id.
60 61 62 |
# File 'lib/moco/entities.rb', line 60 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
60 61 62 |
# File 'lib/moco/entities.rb', line 60 def name @name end |
#project_id ⇒ Object
Returns the value of attribute project_id.
60 61 62 |
# File 'lib/moco/entities.rb', line 60 def project_id @project_id end |
Instance Method Details
#activities ⇒ Object
12 13 14 |
# File 'lib/moco/entities/task.rb', line 12 def activities client.activities.where(task_id: id) end |
#project ⇒ Object
Associations
8 9 10 |
# File 'lib/moco/entities/task.rb', line 8 def project @project ||= client.projects.find(project_id) if project_id end |
#to_s ⇒ Object
62 63 64 |
# File 'lib/moco/entities.rb', line 62 def to_s name end |