diff --git a/lib/todo-txt/task.rb b/lib/todo-txt/task.rb index 2df8ad1..6b9febd 100644 --- a/lib/todo-txt/task.rb +++ b/lib/todo-txt/task.rb @@ -45,7 +45,6 @@ def initialize task @orig = task @completed_on = get_completed_date #orig.scan(self.class.done_regex)[1] ||= nil @priority, @created_on = orig_priority, orig_created_on - @done = !@completed_on.nil? @contexts ||= orig.scan(self.class.contexts_regex).map { |item| item.strip } @projects ||= orig.scan(self.class.projects_regex).map { |item| item.strip } end @@ -170,7 +169,7 @@ def overdue? # task.done? # #=> false def done? - @done + !@completed_on.nil? end # Completes the task on the current date. @@ -189,7 +188,6 @@ def done? def do! @completed_on = Date.today @priority = nil - @done = true end # Marks the task as incomplete and resets its original due date. @@ -208,7 +206,6 @@ def do! def undo! @completed_on = nil @priority = orig_priority - @done = false end # Toggles the task from complete to incomplete or vice versa.