Class: Gerrit::Command::Base Abstract
- Inherits:
-
Object
- Object
- Gerrit::Command::Base
- Includes:
- Utils
- Defined in:
- lib/gerrit/command/base.rb
Overview
This class is abstract.
Abstract base class of all commands.
Instance Method Summary collapse
-
#execute ⇒ Object
Executes the command given the previously-parsed arguments.
-
#initialize(config, ui, arguments) ⇒ Base
constructor
A new instance of Base.
-
#run ⇒ Object
Parses arguments and executes the command.
Methods included from Utils
camel_case, commit_hash?, map_in_parallel, snake_case
Constructor Details
#initialize(config, ui, arguments) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 |
# File 'lib/gerrit/command/base.rb', line 13 def initialize(config, ui, arguments) @config = config @ui = ui @arguments = arguments end |
Instance Method Details
#execute ⇒ Object
Executes the command given the previously-parsed arguments.
27 28 29 |
# File 'lib/gerrit/command/base.rb', line 27 def execute raise NotImplementedError, 'Define `execute` in Command subclass' end |
#run ⇒ Object
Parses arguments and executes the command.
20 21 22 23 24 |
# File 'lib/gerrit/command/base.rb', line 20 def run # TODO: include a parse step here and remove duplicate parsing code from # individual commands execute end |