Class: Task
- Inherits:
-
Object
- Object
- Task
- Defined in:
- lib/todown/task.rb
Overview
Represent a task extracted from markdown file
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
readonly
An hash containing various attributes.
-
#finished ⇒ Boolean
readonly
The status of the task (‘true` for completed, `false` for to do).
-
#name ⇒ String
readonly
The name of the task.
Instance Method Summary collapse
-
#initialize(name, finished = false, attributes = {}) ⇒ Task
constructor
Returns a new instance of Task.
Constructor Details
#initialize(name, finished = false, attributes = {}) ⇒ Task
Returns a new instance of Task
15 16 17 18 19 20 21 |
# File 'lib/todown/task.rb', line 15 def initialize(name, finished = false, attributes = {}) @name = name @finished = finished @attributes = attributes parse_attributes! end |
Instance Attribute Details
#attributes ⇒ Hash (readonly)
Returns an hash containing various attributes.
8 9 10 |
# File 'lib/todown/task.rb', line 8 def attributes @attributes end |
#finished ⇒ Boolean (readonly)
Returns The status of the task (‘true` for completed, `false` for to do).
6 7 8 |
# File 'lib/todown/task.rb', line 6 def finished @finished end |
#name ⇒ String (readonly)
Returns The name of the task.
4 5 6 |
# File 'lib/todown/task.rb', line 4 def name @name end |