Class: Chimps::Commands::Show

Inherits:
Chimps::Command show all
Includes:
Utils::UsesModel
Defined in:
lib/chimps/commands/show.rb

Constant Summary collapse

"usage: chimps show [OPTIONS] ID_OR_HANDLE"
HELP =
"\nReturn a description of the resource (defaults to dataset) with the\ngiven ID or HANDLE\n"
MODELS =

Models this command applies to (default first)

%w[dataset collection source license tag category]

Instance Attribute Summary

Attributes inherited from Chimps::Command

#argv

Instance Method Summary collapse

Methods included from Utils::UsesModel

#define_model_option, #model, #model=, #model_identifier, #models_path, #models_string, #plural_model

Methods inherited from Chimps::Command

#initialize, name, #name

Constructor Details

This class inherits a constructor from Chimps::Command

Instance Method Details

#execute!Object



25
26
27
# File 'lib/chimps/commands/show.rb', line 25

def execute!
  puts Chimps::Request.new(model_path).get.body
end

#model_pathObject

The path of the URL to send a Request to.

This is different from Chimps::Commands::UsesModel in that it submits to the YAML path.



21
22
23
# File 'lib/chimps/commands/show.rb', line 21

def model_path
  "#{plural_model}/#{model_identifier}.yaml"
end