Class: IV::CLI::Command

Inherits:
Object
  • Object
show all
Includes:
Helpers::Errors, Helpers::SubclassRegistration, Mixlib::CLI
Defined in:
lib/iv-cli/command.rb

Direct Known Subclasses

Init, Nodes

Defined Under Namespace

Classes: Init, Nodes

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Helpers::SubclassRegistration

included

Methods included from Helpers::Errors

included

Instance Attribute Details

#iv_configObject (readonly)

Returns the value of attribute iv_config.



12
13
14
# File 'lib/iv-cli/command.rb', line 12

def iv_config
  @iv_config
end

Class Method Details

.invalid_command?(command) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/iv-cli/command.rb', line 18

def self.invalid_command? command
  ! subclasses.include? command
end

.run_command(args, options = {}) ⇒ Object



14
15
16
# File 'lib/iv-cli/command.rb', line 14

def self.run_command args, options = {}
  subclass_class(args.shift).new.run(args, options)
end