Method: Thor::Base::ClassMethods#all_commands

Defined in:
lib/thor/base/class_methods.rb

#all_commandsHashWithIndifferentAccess<String, Thor::Command> Also known as: all_tasks

Returns the commands for this Thor class and all subclasses.

Returns:

  • (HashWithIndifferentAccess<String, Thor::Command>)

    An hash with commands names as keys and Command objects as values.



228
229
230
231
232
# File 'lib/thor/base/class_methods.rb', line 228

def all_commands
  @all_commands ||= from_superclass(  :all_commands,
                                      HashWithIndifferentAccess.new )
  @all_commands.merge!(commands)
end