Class: Vvm::CLI::Command::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/vvm/cli/command/base.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_nameObject

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

#envObject (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