Class: TaskWarrior::Dependencies::TaskPresenter

Inherits:
Presenter
  • Object
show all
Defined in:
lib/twdeps/task_presenter.rb

Overview

Presents a task’s attributes suitable for a GraphViz node

Instance Attribute Summary

Attributes inherited from Presenter

#attributes, #id

Instance Method Summary collapse

Constructor Details

#initialize(task) ⇒ TaskPresenter

Returns a new instance of TaskPresenter.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/twdeps/task_presenter.rb', line 7

def initialize(task)
  self.id = task.uuid
  self.attributes = {
    :label => task.description,
    :tooltip => "Status: #{task.status}"
  }

  if :completed == task.status
    self.attributes.merge!({:fontcolor => 'gray', :color => 'gray'})
  end
end