Class: Ppl::Command::Rm
- Inherits:
-
Application::Command
- Object
- Application::Command
- Ppl::Command::Rm
- Defined in:
- lib/ppl/command/rm.rb
Instance Attribute Summary
Attributes inherited from Application::Command
Instance Method Summary collapse
Methods inherited from Application::Command
Instance Method Details
#execute(input, output) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ppl/command/rm.rb', line 10 def execute(input, output) contact_id = input.arguments.first if contact_id.nil? raise Ppl::Error::IncorrectUsage, "No contact specified" end contact = @storage.require_contact(contact_id) @storage.delete_contact(contact) return true end |
#options(parser, options) ⇒ Object
6 7 8 |
# File 'lib/ppl/command/rm.rb', line 6 def (parser, ) parser. = "usage: ppl rm <contact>" end |