Class: Action
- Inherits:
-
Object
- Object
- Action
- Extended by:
- Abbreviations, Dependency::ClassMethod
- Includes:
- ActionInFile, ActionTextInProjectFile, Dependency::Methods, Status
- Defined in:
- lib/gtd.rb,
lib/action_persistence.rb
Constant Summary
Constants included from ActionInFile
Constants included from Status
Status::ACTIVE_STATES, Status::INACTIVE_STATES, Status::STATUS_ORDER, Status::STATUS_SYMBOLS, Status::SYMBOLS_STATUS
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#project ⇒ Object
Returns the value of attribute project.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(description, context, project = '', status = :unprocessed, info = '') ⇒ Action
constructor
A new instance of Action.
- #to_s ⇒ Object
Methods included from Abbreviations
Methods included from ActionInFile
Methods included from ActionFileUtil
Methods included from Status
#active, #directory_name, #inactive, #index, #symbol, #with_status
Methods included from ActionTextInProjectFile
Constructor Details
#initialize(description, context, project = '', status = :unprocessed, info = '') ⇒ Action
Returns a new instance of Action.
194 195 196 197 198 199 200 201 |
# File 'lib/gtd.rb', line 194 def initialize (description,context,project='',status=:unprocessed,info='') @description = description.strip @context=context #@proposed_context @project=project @info=info @status = status end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
192 193 194 |
# File 'lib/gtd.rb', line 192 def context @context end |
#project ⇒ Object
Returns the value of attribute project.
192 193 194 |
# File 'lib/gtd.rb', line 192 def project @project end |
Class Method Details
.parse(line) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/action_persistence.rb', line 12 def Action::parse(line) begin action_details = {} line =~ LINE_EXP action_details[:description] = $3.strip action_details[:info] = $5 || '' action_details[:status] = SYMBOLS_STATUS[$1] || :unprocessed action_details[:context] = ($2.strip) rescue log "Problem parsing #{line}" throw end #action = Action.new(description,context,nil,status,info) return action_details end |
Instance Method Details
#to_s ⇒ Object
203 204 205 206 |
# File 'lib/gtd.rb', line 203 def to_s "#{@description} (#{@context.name}, #{@project.name}, #{status})" end |