Class: Foobara::CommandConnector::Commands::ListCommands
- Inherits:
-
Foobara::Command
- Object
- Foobara::Command
- Foobara::CommandConnector::Commands::ListCommands
- Defined in:
- foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb
Direct Known Subclasses
Foobara::CommandConnectors::ShCliConnector::Commands::ListCommands, McpConnector::Commands::ListCommands
Constant Summary
Constants included from TruncatedInspect
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
Attributes included from Foobara::CommandPatternImplementation::Concerns::Subcommands
Attributes included from Foobara::CommandPatternImplementation::Concerns::Runtime
Attributes included from Foobara::CommandPatternImplementation::Concerns::Errors
Attributes included from Foobara::CommandPatternImplementation::Concerns::Inputs
Instance Method Summary collapse
- #build_list ⇒ Object
- #build_result ⇒ Object
- #command_connector ⇒ Object
- #execute ⇒ Object
- #verbose? ⇒ Boolean
Methods inherited from Foobara::Command
Methods included from Foobara::Concern
foobara_class_methods_module_for, foobara_concern?, included
Methods included from Foobara::CommandPatternImplementation::Concerns::Reflection
Methods included from Foobara::CommandPatternImplementation::Concerns::DomainMappers
#domain_map, #domain_map!, #run_mapped_subcommand!
Methods included from Foobara::CommandPatternImplementation::Concerns::Subcommands
#run_subcommand!, #subcommand?
Methods included from Foobara::CommandPatternImplementation::Concerns::Entities
Methods included from Foobara::CommandPatternImplementation::Concerns::Transactions
#auto_detect_current_transactions, #commit_transaction, #open_transaction, #opened_transactions, #relevant_entity_classes, #rollback_transaction, #transactions
Methods included from Foobara::CommandPatternImplementation::Concerns::StateMachine
Methods included from Foobara::CommandPatternImplementation::Concerns::Runtime
#halt!, #run, #run!, #run_execute, #succeed, #success?, #validate, #validate_records
Methods included from Foobara::CommandPatternImplementation::Concerns::Errors
Methods included from Foobara::CommandPatternImplementation::Concerns::Inputs
#cast_and_validate_inputs, #initialize, #method_missing, #respond_to_missing?, #respond_to_missing_for_inputs?
Methods included from TruncatedInspect
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Foobara::CommandPatternImplementation::Concerns::Inputs
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
23 24 25 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb', line 23 def list @list end |
Instance Method Details
#build_list ⇒ Object
25 26 27 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb', line 25 def build_list self.list = command_connector.command_registry.all_transformed_command_classes end |
#build_result ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb', line 33 def build_result if verbose? list.map do |command_class| [command_class.full_command_name, command_class.description] end else list.map do |command_class| [command_class.full_command_name, nil] end end end |
#command_connector ⇒ Object
45 46 47 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb', line 45 def command_connector request.command_connector end |
#execute ⇒ Object
18 19 20 21 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb', line 18 def execute build_list build_result end |
#verbose? ⇒ Boolean
29 30 31 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_connector/commands/list_commands.rb', line 29 def verbose? verbose end |