Class: MooTool::ControllerBase

Inherits:
Object
  • Object
show all
Defined in:
lib/mootool/controller_base.rb

Overview

Controller base is the base class for all controllers that respond to command line requests.

Class Method Summary collapse

Class Method Details

.command(command = nil) ⇒ Object



27
28
29
30
# File 'lib/mootool/controller_base.rb', line 27

def command(command = nil)
  @command = command if command
  @command
end

.description(description) ⇒ Object



32
33
34
# File 'lib/mootool/controller_base.rb', line 32

def description(description)
  @description = description
end

.for_controller(name) ⇒ Object



17
18
19
# File 'lib/mootool/controller_base.rb', line 17

def self.for_controller(name)
  @@controllers.find { |c| c.command == name }
end

.inherited(child) ⇒ Object



21
22
23
24
# File 'lib/mootool/controller_base.rb', line 21

def self.inherited(child)
  @@controllers << child
  super
end

.load_allObject



11
12
13
14
15
# File 'lib/mootool/controller_base.rb', line 11

def self.load_all
  Dir.glob(File.join(CONTROLLERS_PATH, '*')).each do |file|
    require file
  end
end