Class: UltraCommandLine::Manager::Base

Inherits:
Object
  • Object
show all
Extended by:
Factory
Includes:
Commands, LayeredDefinition, Processors, Utils::ErrorPropagation
Defined in:
lib/ultra_command_line/manager/base.rb

Constant Summary

Constants included from Processors

Processors::MANDATORY_PROCESSOR_METHODS

Constants included from Utils::ErrorPropagation

Utils::ErrorPropagation::DEFAULT_ERROR_MESSAGE

Instance Attribute Summary

Attributes included from Commands

#commands

Instance Method Summary collapse

Methods included from Factory

from_hash

Methods included from Utils::YamlFactory

#from_yaml, #from_yaml_file

Methods included from Processors

#clear_processors, #processor, #processors, #register_processor

Methods included from Commands

#aliases_consistent?, #cmd_line_args_for_command, #command, #command_by_alias, #root_command

Methods included from CmdLineArgs

#cmd_line_args, #cmd_line_args=

Methods included from LayeredDefinition

#[]=, #clear, #contribute_to_definition, #definition_hash, #initialize_definition, #refresh

Constructor Details

#initialize(commands = []) ⇒ Base

Returns a new instance of Base.



21
22
23
# File 'lib/ultra_command_line/manager/base.rb', line 21

def initialize(commands = [])
  @commands = commands
end

Instance Method Details

#definition_hash_to_commandsObject



25
26
27
28
29
30
# File 'lib/ultra_command_line/manager/base.rb', line 25

def definition_hash_to_commands
  self.class.from_hash(definition_hash) do |commands|
    commands.each {|command| command.send :manager=, self }
    @commands = commands
  end
end