Class: RCoLi::Command

Inherits:
Object
  • Object
show all
Includes:
CommandContainer
Defined in:
lib/rcoli/model.rb

Instance Attribute Summary

Attributes included from CommandContainer

#parent

Instance Method Summary collapse

Methods included from CommandContainer

#action, #command, #commands, #find_command, #flag, #get_action, #options, #parse_args, #put_default_values, #switch, #validate_options

Constructor Details

#initialize(name) ⇒ Command

Returns a new instance of Command.



172
173
174
# File 'lib/rcoli/model.rb', line 172

def initialize(name)
  @name = name
end

Instance Method Details

#full_commandObject



178
179
180
181
182
183
184
185
186
# File 'lib/rcoli/model.rb', line 178

def full_command
  command = self
  result = []
  while(command.parent) do
    result << command.value_of_name
    command = command.parent
  end
  return result.reverse.join(' ')
end