Class: ChefCLI::CommandsMap::CommandSpec

Inherits:
Struct
  • Object
show all
Defined in:
lib/chef-cli/commands_map.rb,
lib/chef-cli/commands_map.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#constant_nameObject

Returns the value of attribute constant_name

Returns:

  • (Object)

    the current value of constant_name



57
58
59
# File 'lib/chef-cli/commands_map.rb', line 57

def constant_name
  @constant_name
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



57
58
59
# File 'lib/chef-cli/commands_map.rb', line 57

def description
  @description
end

#hiddenObject

Returns the value of attribute hidden

Returns:

  • (Object)

    the current value of hidden



57
58
59
# File 'lib/chef-cli/commands_map.rb', line 57

def hidden
  @hidden
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



57
58
59
# File 'lib/chef-cli/commands_map.rb', line 57

def name
  @name
end

#require_pathObject

Returns the value of attribute require_path

Returns:

  • (Object)

    the current value of require_path



57
58
59
# File 'lib/chef-cli/commands_map.rb', line 57

def require_path
  @require_path
end

Instance Method Details

#instantiateObject



61
62
63
64
65
# File 'lib/chef-cli/commands_map.rb', line 61

def instantiate
  require require_path
  command_class = ChefCLI::Command.const_get(constant_name)
  command_class.new
end