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.
-
#context ⇒ Object
Returns the value of attribute context.
-
#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.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/smart_todo/todo.rb', line 9 def initialize(source, filepath = "-e") @filepath = filepath @comment = +"" @indent = source[/^#(\s+)/, 1].length @events = [] @assignees = [] @context = nil @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 |
#context ⇒ Object
Returns the value of attribute context.
7 8 9 |
# File 'lib/smart_todo/todo.rb', line 7 def context @context 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
22 23 24 |
# File 'lib/smart_todo/todo.rb', line 22 def <<(source) comment << source end |