Class: Vvm::CLI::Command::Base
- Inherits:
-
Object
- Object
- Vvm::CLI::Command::Base
- Extended by:
- Forwardable
- Defined in:
- lib/vvm/cli/command/base.rb
Direct Known Subclasses
ConfirmDispsense, ConfirmProductPick, Dispsense, Exit, ShowCoins, ShowMainMenu, ShowProducts
Class Attribute Summary collapse
-
.command_name ⇒ Object
Returns the value of attribute command_name.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(env) ⇒ Base
Returns a new instance of Base.
28 29 30 |
# File 'lib/vvm/cli/command/base.rb', line 28 def initialize(env) @env = env end |
Class Attribute Details
.command_name ⇒ Object
Returns the value of attribute command_name.
16 17 18 |
# File 'lib/vvm/cli/command/base.rb', line 16 def command_name @command_name end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/vvm/cli/command/base.rb', line 9 def env @env end |
Class Method Details
.by_command_name(name) ⇒ Object
23 24 25 |
# File 'lib/vvm/cli/command/base.rb', line 23 def by_command_name(name) @subclasses.detect { |s| s.command_name == name } end |
.inherited(subclass) ⇒ Object
18 19 20 21 |
# File 'lib/vvm/cli/command/base.rb', line 18 def inherited(subclass) super @subclasses << subclass end |