Class: Smith::Commands::List
- Inherits:
-
Smith::CommandBase
- Object
- Smith::CommandBase
- Smith::Commands::List
- Defined in:
- lib/smith/commands/agency/list.rb
Instance Attribute Summary
Attributes inherited from Smith::CommandBase
Instance Method Summary collapse
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
5 6 7 8 9 10 11 12 13 |
# File 'lib/smith/commands/agency/list.rb', line 5 def execute if target.size > 0 selected_agents = agents.find_by_name(target) else selected_agents = ([:all]) ? agents.to_a : agents.state(:running) end responder.succeed((selected_agents.empty?) ? '' : format(selected_agents, [:long])) end |