Class: CLI::Kit::Resolver
- Inherits:
-
Object
- Object
- CLI::Kit::Resolver
- Extended by:
- T::Sig
- Defined in:
- lib/cli/kit/resolver.rb
Instance Method Summary collapse
- #call(args) ⇒ Object
-
#initialize(tool_name:, command_registry:) ⇒ Resolver
constructor
A new instance of Resolver.
Methods included from T::Sig
Constructor Details
#initialize(tool_name:, command_registry:) ⇒ Resolver
Returns a new instance of Resolver.
11 12 13 14 |
# File 'lib/cli/kit/resolver.rb', line 11 def initialize(tool_name:, command_registry:) @tool_name = tool_name @command_registry = command_registry end |
Instance Method Details
#call(args) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cli/kit/resolver.rb', line 17 def call(args) args = args.dup command_name = args.shift command, resolved_name = @command_registry.lookup_command(command_name) if command.nil? command_not_found(command_name) raise CLI::Kit::AbortSilent # Already output message end [command, resolved_name, args] end |