Class: TooDoo::Commands::Remove

Inherits:
Base
  • Object
show all
Defined in:
lib/toodoo/commands/remove.rb

Overview

remove a task usage: td remove <body>

Instance Attribute Summary

Attributes inherited from Base

#args, #store

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run!

Constructor Details

This class inherits a constructor from TooDoo::Commands::Base

Instance Method Details

#descriptionObject



8
9
10
11
12
13
# File 'lib/toodoo/commands/remove.rb', line 8

def description
  <<~END
    remove a task
    usage: td remove <body>
  END
end

#perform!Object



15
16
17
18
19
20
# File 'lib/toodoo/commands/remove.rb', line 15

def perform!
  return puts(description) if args.empty?

  result = store.remove(args.join(' '))
  puts build_message(result)
end