Class: TodoTxtViewer::TaskLine
- Inherits:
-
Object
- Object
- TodoTxtViewer::TaskLine
- Defined in:
- lib/todo_txt_viewer/task_line.rb
Constant Summary collapse
- ALLOWED_ACTIONS =
i(do! undo! priority_inc! priority_dec!).freeze
Instance Attribute Summary collapse
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(task) ⇒ TaskLine
constructor
A new instance of TaskLine.
- #task_action(action) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(task) ⇒ TaskLine
Returns a new instance of TaskLine.
9 10 11 |
# File 'lib/todo_txt_viewer/task_line.rb', line 9 def initialize task @task = task end |
Instance Attribute Details
#task ⇒ Object (readonly)
Returns the value of attribute task.
7 8 9 |
# File 'lib/todo_txt_viewer/task_line.rb', line 7 def task @task end |
Instance Method Details
#task_action(action) ⇒ Object
17 18 19 20 21 |
# File 'lib/todo_txt_viewer/task_line.rb', line 17 def task_action action raise "illegal action #{action}" unless ALLOWED_ACTIONS.include? action task.send action end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/todo_txt_viewer/task_line.rb', line 13 def to_s task.to_s end |