Class: Smith::Commands::Group
- Inherits:
-
Smith::CommandBase
- Object
- Smith::CommandBase
- Smith::Commands::Group
- Includes:
- Common
- Defined in:
- lib/smith/commands/agency/group.rb
Instance Attribute Summary
Attributes inherited from Smith::CommandBase
Instance Method Summary collapse
- #execute ⇒ Object
-
#group(&blk) ⇒ Object
Returns the agents in a group.
- #options_spec ⇒ Object
Methods included from Common
Methods inherited from Smith::CommandBase
#banner, #format_help, #initialize, #parse_options
Methods included from Logger
Constructor Details
This class inherits a constructor from Smith::CommandBase
Instance Method Details
#execute ⇒ Object
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 23 |
# File 'lib/smith/commands/agency/group.rb', line 16 def group(&blk) separator = ([:one_column]) ? "\n" : " " begin blk.call(agent_group(target.first).join(separator)) rescue RuntimeError => e blk.call(e.) end end |
#options_spec ⇒ Object
25 26 27 28 29 |
# File 'lib/smith/commands/agency/group.rb', line 25 def "Lists the agents in a group.", "<group>" opt :one_column, "Lists one agent per line", :short => :s end |