Class: Abt::BaseCommand
- Inherits:
-
Object
- Object
- Abt::BaseCommand
- Extended by:
- Forwardable
- Defined in:
- lib/abt/base_command.rb
Direct Known Subclasses
Cli::GlobalCommands::Commands, Cli::GlobalCommands::Examples, Cli::GlobalCommands::Help, Cli::GlobalCommands::Readme, Cli::GlobalCommands::Share, Cli::GlobalCommands::Version, Providers::Asana::BaseCommand, Providers::Devops::BaseCommand, Providers::Git::Commands::Branch, Providers::Harvest::BaseCommand
Instance Attribute Summary collapse
-
#ari ⇒ Object
readonly
Returns the value of attribute ari.
-
#cli ⇒ Object
readonly
Returns the value of attribute cli.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ari:, cli:) ⇒ BaseCommand
constructor
A new instance of BaseCommand.
- #perform ⇒ Object
Constructor Details
#initialize(ari:, cli:) ⇒ BaseCommand
Returns a new instance of BaseCommand.
23 24 25 26 27 |
# File 'lib/abt/base_command.rb', line 23 def initialize(ari:, cli:) @cli = cli @ari = ari @flags = parse_flags(ari.flags) end |
Instance Attribute Details
#ari ⇒ Object (readonly)
Returns the value of attribute ari.
19 20 21 |
# File 'lib/abt/base_command.rb', line 19 def ari @ari end |
#cli ⇒ Object (readonly)
Returns the value of attribute cli.
19 20 21 |
# File 'lib/abt/base_command.rb', line 19 def cli @cli end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
19 20 21 |
# File 'lib/abt/base_command.rb', line 19 def flags @flags end |
Class Method Details
.description ⇒ Object
11 12 13 |
# File 'lib/abt/base_command.rb', line 11 def self.description raise NotImplementedError, "Command classes must implement .description" end |
.flags ⇒ Object
15 16 17 |
# File 'lib/abt/base_command.rb', line 15 def self.flags [] end |
.usage ⇒ Object
7 8 9 |
# File 'lib/abt/base_command.rb', line 7 def self.usage raise NotImplementedError, "Command classes must implement .usage" end |
Instance Method Details
#perform ⇒ Object
29 30 31 |
# File 'lib/abt/base_command.rb', line 29 def perform raise NotImplementedError, "Command classes must implement #perform" end |