Class: Mutant::CLI::Command Private
- Inherits:
-
Object
- Object
- Mutant::CLI::Command
- Includes:
- AbstractType
- Defined in:
- lib/mutant/cli/command.rb,
lib/mutant/cli/command/run.rb,
lib/mutant/cli/command/root.rb,
lib/mutant/cli/command/subscription.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
rubocop:disable Metrics/ClassLength
Direct Known Subclasses
Defined Under Namespace
Classes: FailParse, OptionParser, Root, Run, Subscription
Constant Summary collapse
- OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[].freeze
- SUBCOMMANDS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[].freeze
Class Method Summary collapse
-
.command_name ⇒ String
private
Command name.
-
.parse(**attributes) ⇒ Command
private
Parse command.
-
.short_description ⇒ String
private
Command short description.
Instance Method Summary collapse
-
#call ⇒ Bool
private
Execute the command, invoke its side effects.
-
#full_name ⇒ String
private
Commands full name.
-
#zombie? ⇒ Bool
private
Test if command needs to be executed in zombie environment.
Class Method Details
.command_name ⇒ String
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.
Command name
40 41 42 |
# File 'lib/mutant/cli/command.rb', line 40 def self.command_name self::NAME end |
.parse(**attributes) ⇒ Command
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.
Parse command
33 34 35 |
# File 'lib/mutant/cli/command.rb', line 33 def self.parse(**attributes) new(main: nil, parent: nil, **attributes).__send__(:parse) end |
.short_description ⇒ String
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.
Command short description
47 48 49 |
# File 'lib/mutant/cli/command.rb', line 47 def self.short_description self::SHORT_DESCRIPTION end |
Instance Method Details
#call ⇒ Bool
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.
Execute the command, invoke its side effects
54 55 56 |
# File 'lib/mutant/cli/command.rb', line 54 def call main ? main.call : execute end |
#full_name ⇒ String
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.
Commands full name
61 62 63 |
# File 'lib/mutant/cli/command.rb', line 61 def full_name [*parent&.full_name, self.class.command_name].join(' ') end |
#zombie? ⇒ Bool
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.
Test if command needs to be executed in zombie environment
68 69 70 |
# File 'lib/mutant/cli/command.rb', line 68 def zombie? instance_of?(Run) end |