Class: Chimps::Commands::Create
- Inherits:
-
Chimps::Command
- Object
- Chimps::Command
- Chimps::Commands::Create
- Includes:
- Utils::ActsOnResource, Utils::UsesParamValueData
- Defined in:
- lib/chimps-cli/commands/create.rb
Overview
A command to issue a POST requst to create a resource at Infochimps.
Constant Summary collapse
- USAGE =
"usage: chimps create [OPTIONS] [PROP=VALUE] ..."- HELP =
"\nCreate a \#{default_resource_type} using the properties and values supplied.\n\n\#{how_to_input_data}\n\#{resources_listing}\n\nExamples:\n\n $ chimps create title='My Awesome Dataset' description=\"It is cool\"\n $ chimps create source -d my_source.yml\n"
Instance Attribute Summary
Attributes inherited from Chimps::Command
Class Method Summary collapse
Instance Method Summary collapse
-
#execute! ⇒ Object
Issue the POST request.
Methods included from Utils::UsesParamValueData
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
11 12 13 |
# File 'lib/chimps-cli/commands/create.rb', line 11 def self.allowed_models %w[dataset source license] end |
Instance Method Details
#execute! ⇒ Object
Issue the POST request.
30 31 32 33 |
# File 'lib/chimps-cli/commands/create.rb', line 30 def execute! ensure_data_is_present! Request.new(resources_path, :body => { resource_type => data}, :sign => true).post.print(:yaml => true) end |