Class: Harvest::TrackableProject

Inherits:
Hashie::Mash
  • Object
show all
Includes:
Model
Defined in:
lib/harvest/trackable_project.rb

Overview

The model for project-tasks combinations that can be added to the timesheet

Fields

id

the id of the project

name

the name of the project

client

the name of the client of the project

client_id

the client id of the project

tasks

trackable tasks for the project

Defined Under Namespace

Classes: Task

Instance Method Summary collapse

Methods included from Model

included

Constructor Details

#initialize(args = {}, _ = nil) ⇒ TrackableProject

Returns a new instance of TrackableProject



16
17
18
19
20
# File 'lib/harvest/trackable_project.rb', line 16

def initialize(args = {}, _ = nil)
  args       = args.to_hash.stringify_keys
  self.tasks = args.delete("tasks") if args["tasks"]
  super
end

Instance Method Details

#tasks=(tasks) ⇒ Object



22
23
24
# File 'lib/harvest/trackable_project.rb', line 22

def tasks=(tasks)
  self["tasks"] = Task.parse(tasks)
end