Class: Hanami::CLI::Registry::Prefix
- Inherits:
-
Object
- Object
- Hanami::CLI::Registry::Prefix
- Defined in:
- lib/hanami/cli/registry.rb
Overview
Command name prefix
Instance Method Summary collapse
-
#initialize(registry, prefix, aliases) ⇒ Prefix
constructor
private
A new instance of Prefix.
- #register(name, command, aliases: [], **options) ⇒ Object
Constructor Details
#initialize(registry, prefix, aliases) ⇒ Prefix
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Prefix.
301 302 303 304 305 306 |
# File 'lib/hanami/cli/registry.rb', line 301 def initialize(registry, prefix, aliases) @registry = registry @prefix = prefix registry.set(prefix, nil, aliases) end |
Instance Method Details
#register(name, command, aliases: [], **options) ⇒ Object
311 312 313 314 |
# File 'lib/hanami/cli/registry.rb', line 311 def register(name, command, aliases: [], **) command_name = "#{prefix} #{name}" registry.set(command_name, command, aliases, **) end |