Class: EPC::Command::CreateGroupCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- EPC::Command::CreateGroupCommand
- Defined in:
- lib/epc/command/group/create_group_command.rb
Constant Summary
Constants inherited from BaseCommand
BaseCommand::GIVEUP_TICKS, BaseCommand::SLEEP_TIME, BaseCommand::TICKER_TICKS
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
Methods inherited from BaseCommand
#go, inherited, #initialize, required_options
Methods included from PersistentAttributes
#auth_token, #caller_id, #target_url
Constructor Details
This class inherits a constructor from EPC::Command::BaseCommand
Instance Method Details
#execute(*params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/epc/command/group/create_group_command.rb', line 4 def execute(*params) name = params[1] raise FatalError, "You need to specify a name for the group" if name.blank? status, response, headers = client.post(EPC::Config::GROUPS_PATH, {:name => name}) if status.successful? say("Group [#{name}] created") else say("Failed to create [#{name}] group: [#{response[:message]}]") end return status end |