Class: Chimps::Commands::Destroy
- Inherits:
-
Chimps::Command
- Object
- Chimps::Command
- Chimps::Commands::Destroy
- Includes:
- Utils::ActsOnResource
- Defined in:
- lib/chimps-cli/commands/destroy.rb
Overview
A command to issue a DELETE request against a resource at Infochimps.
Constant Summary collapse
- USAGE =
"usage: chimps destroy [OPTIONS] [RESOURCE] ID_OR_SLUG"- HELP =
"\nDestroys a \#{default_resource_type} identified by the given ID or slug.\n\n\#{resources_listing}\n\nYou can only destroy resources that you own.\n\nExamples:\n\n $ chimps destroy my-crappy-dataset\n $ chimps destroy source 7837\n"
Instance Attribute Summary
Attributes inherited from Chimps::Command
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Utils::ActsOnResource
#first_arg_is_resource_type?, #has_resource_identifier?, included, #plural_resource, #resource_identifier, #resource_path, #resource_type, #resources_path
Methods inherited from Chimps::Command
Constructor Details
This class inherits a constructor from Chimps::Command
Class Method Details
.allowed_models ⇒ Object
10 11 12 |
# File 'lib/chimps-cli/commands/destroy.rb', line 10 def self.allowed_models %w[dataset source license] end |
Instance Method Details
#execute! ⇒ Object
29 30 31 |
# File 'lib/chimps-cli/commands/destroy.rb', line 29 def execute! Request.new(resource_path, :sign => true).delete.print end |