Class: Ptimelog::Command::Add
Overview
add a new entrie with the current date and time
Instance Method Summary collapse
-
#initialize(task) ⇒ Add
constructor
A new instance of Add.
- #needs_entries? ⇒ Boolean
- #run ⇒ Object
Methods inherited from Base
Constructor Details
Instance Method Details
#needs_entries? ⇒ Boolean
17 18 19 |
# File 'lib/ptimelog/command/add.rb', line 17 def needs_entries? false end |
#run ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ptimelog/command/add.rb', line 21 def run add_empty_line if @timelog.previous_entry.date == yesterday add_entry(*parse_task(@task)) save_file end |