Class: Smith::Commands::Group

Inherits:
Smith::CommandBase show all
Includes:
Common
Defined in:
lib/smith/commands/agency/group.rb

Instance Attribute Summary

Attributes inherited from Smith::CommandBase

#options, #target

Instance Method Summary collapse

Methods included from Common

#agent_group

Methods inherited from Smith::CommandBase

#banner, #format_help, #initialize, #parse_options

Methods included from Logger

included

Constructor Details

This class inherits a constructor from Smith::CommandBase

Instance Method Details

#executeObject



9
10
11
12
13
# File 'lib/smith/commands/agency/group.rb', line 9

def execute
  group do |value|
    responder.succeed(value)
  end
end

#group(&blk) ⇒ Object

Returns the agents in a group.



16
17
18
19
20
21
22
# File 'lib/smith/commands/agency/group.rb', line 16

def group(&blk)
  begin
    blk.call(agent_group(target.first).join(' '))
  rescue RuntimeError => e
    blk.call(e.message)
  end
end

#options_specObject



24
25
26
# File 'lib/smith/commands/agency/group.rb', line 24

def options_spec
  banner "Lists the agents in a group."
end