Class: ActionItem
- Inherits:
-
Object
- Object
- ActionItem
- Defined in:
- lib/startask.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
- #done ⇒ Object (also: #completed)
-
#initialize(s) ⇒ ActionItem
constructor
A new instance of ActionItem.
- #started ⇒ Object
- #status ⇒ Object
- #status=(status) ⇒ Object
- #stopped ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(s) ⇒ ActionItem
Returns a new instance of ActionItem.
13 14 15 16 |
# File 'lib/startask.rb', line 13 def initialize(s) @title = s @log = [] end |
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
11 12 13 |
# File 'lib/startask.rb', line 11 def log @log end |
Instance Method Details
#done ⇒ Object Also known as: completed
18 19 20 |
# File 'lib/startask.rb', line 18 def done() logit :completed end |
#started ⇒ Object
28 29 30 |
# File 'lib/startask.rb', line 28 def started() logit :started end |
#status ⇒ Object
32 33 34 |
# File 'lib/startask.rb', line 32 def status() @log.last end |
#status=(status) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/startask.rb', line 40 def status=(status) case status when :done done() when :started started() end end |
#stopped ⇒ Object
36 37 38 |
# File 'lib/startask.rb', line 36 def stopped() logit :stopped end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/startask.rb', line 24 def to_s() @title end |