Class: SmartTodo::Todo
- Inherits:
-
Object
- Object
- SmartTodo::Todo
- Defined in:
- lib/smart_todo/todo.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#assignees ⇒ Object
readonly
Returns the value of attribute assignees.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
-
#indent ⇒ Object
readonly
Returns the value of attribute indent.
Instance Method Summary collapse
- #<<(source) ⇒ Object
-
#initialize(source, filepath = "-e") ⇒ Todo
constructor
A new instance of Todo.
Constructor Details
#initialize(source, filepath = "-e") ⇒ Todo
Returns a new instance of Todo.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/smart_todo/todo.rb', line 8 def initialize(source, filepath = "-e") @filepath = filepath @comment = +"" @indent = source[/^#(\s+)/, 1].length @events = [] @assignees = [] @errors = [] parse(source[(indent + 1)..]) end |
Instance Attribute Details
#assignees ⇒ Object (readonly)
Returns the value of attribute assignees.
6 7 8 |
# File 'lib/smart_todo/todo.rb', line 6 def assignees @assignees end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
5 6 7 |
# File 'lib/smart_todo/todo.rb', line 5 def comment @comment end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/smart_todo/todo.rb', line 6 def errors @errors end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
6 7 8 |
# File 'lib/smart_todo/todo.rb', line 6 def events @events end |
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
5 6 7 |
# File 'lib/smart_todo/todo.rb', line 5 def filepath @filepath end |
#indent ⇒ Object (readonly)
Returns the value of attribute indent.
5 6 7 |
# File 'lib/smart_todo/todo.rb', line 5 def indent @indent end |
Instance Method Details
#<<(source) ⇒ Object
20 21 22 |
# File 'lib/smart_todo/todo.rb', line 20 def <<(source) comment << source end |