Class: Toodledo::CommandLine::DeleteGoalCommand
- Inherits:
-
BaseCommand
- Object
- CmdParse::Command
- BaseCommand
- Toodledo::CommandLine::DeleteGoalCommand
- Defined in:
- lib/toodledo/command_line/delete_command.rb
Instance Method Summary collapse
- #execute(args) ⇒ Object
-
#initialize(client) ⇒ DeleteGoalCommand
constructor
A new instance of DeleteGoalCommand.
Methods inherited from BaseCommand
Constructor Details
#initialize(client) ⇒ DeleteGoalCommand
Returns a new instance of DeleteGoalCommand.
58 59 60 61 |
# File 'lib/toodledo/command_line/delete_command.rb', line 58 def initialize(client) super(client, 'goal', false) self.short_desc = "Deletes a goal" end |
Instance Method Details
#execute(args) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/toodledo/command_line/delete_command.rb', line 63 def execute(args) Toodledo.begin(client.logger) do |session| line = args.join(' ') client.delete_goal(session, line) end return 0 rescue ItemNotFoundError => e puts e. return -1 end |