Class: Timelog::Command::ClientAdd
- Inherits:
-
Timelog::Command
- Object
- Timelog::Command
- Timelog::Command::ClientAdd
- Defined in:
- lib/timelog/command/client_add.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 |
# File 'lib/timelog/command/client_add.rb', line 4 def execute raise InvalidArgumentError if arguments.size > 2 raise MissingClientNameError unless name = arguments.shift book.clients.add name, arguments.shift "client #{name} added" end |
#help ⇒ Object
12 13 14 |
# File 'lib/timelog/command/client_add.rb', line 12 def help "usage: timelog client add <name> [<shortcut>]" end |