Class: Timelog::Command::Stop
- Inherits:
-
Timelog::Command
- Object
- Timelog::Command
- Timelog::Command::Stop
- Defined in:
- lib/timelog/command/stop.rb
Instance Attribute Summary
Attributes inherited from Timelog::Command
Instance Method Summary collapse
Methods inherited from Timelog::Command
get, inherited, #initialize, known, register, #time_in_arguments
Constructor Details
This class inherits a constructor from Timelog::Command
Instance Method Details
#execute ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/timelog/command/stop.rb', line 4 def execute time = time_in_arguments entry = book.entries.active_or_new entry.description = arguments.join(" ") book.entries.stop entry, at: time "entry stopped" end |
#help ⇒ Object
14 15 16 |
# File 'lib/timelog/command/stop.rb', line 14 def help "usage: timelog stop [<description>] [<time>]" end |