Class: MOCO::Task

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

Attributes inherited from BaseEntity

#attributes, #client

Instance Method Summary collapse

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

#activeObject

Returns the value of attribute active.



60
61
62
# File 'lib/moco/entities.rb', line 60

def active
  @active
end

#billableObject

Returns the value of attribute billable.



60
61
62
# File 'lib/moco/entities.rb', line 60

def billable
  @billable
end

#idObject

Returns the value of attribute id.



60
61
62
# File 'lib/moco/entities.rb', line 60

def id
  @id
end

#nameObject

Returns the value of attribute name.



60
61
62
# File 'lib/moco/entities.rb', line 60

def name
  @name
end

#project_idObject

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

#activitiesObject



12
13
14
# File 'lib/moco/entities/task.rb', line 12

def activities
  client.activities.where(task_id: id)
end

#projectObject

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_sObject



62
63
64
# File 'lib/moco/entities.rb', line 62

def to_s
  name
end