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