Class: Project

Inherits:
Context show all
Extended by:
Dependency::ClassMethod
Includes:
Dependency::Methods, ObservingContainer, ProjectFileWriter, Status
Defined in:
lib/gtd.rb,
lib/project_persistence.rb

Direct Known Subclasses

ProjectFromFile

Constant Summary

Constants included from Status

Status::ACTIVE_STATES, Status::INACTIVE_STATES, Status::STATUS_ORDER, Status::STATUS_SYMBOLS, Status::SYMBOLS_STATUS

Instance Attribute Summary

Attributes inherited from Context

#actions, #name

Instance Method Summary collapse

Methods included from ProjectFileWriter

#project_file_string, #write

Methods included from Status

#active, #directory_name, #inactive, #index, #symbol, #with_status

Methods included from ObservingContainer

#dirty?, #set_dirty, #update

Methods inherited from Context

#delete, #include?

Constructor Details

#initialize(name, status = :processed) ⇒ Project

Returns a new instance of Project.



65
66
67
68
69
# File 'lib/gtd.rb', line 65

def initialize(name,status=:processed)
  super(name)
  @status = status
  @infos = []
end

Instance Method Details

#<<(item) ⇒ Object



70
71
72
73
74
# File 'lib/gtd.rb', line 70

def <<(action)
  log "Setting project #{self} for action #{action}"
  @actions << action
  action.project = self
end

#to_sObject



75
76
77
# File 'lib/gtd.rb', line 75

def to_s
  "#{@status.id2name.capitalize} project #{@name}:\n  " + @actions.join("\n  ")
end