Module: Utopia::Controllers

Defined in:
lib/utopia/controller.rb

Overview

A container for controller classes which are loaded from disk.

Class Method Summary collapse

Class Method Details

.class_name_for_controller(controller) ⇒ Object



36
37
38
# File 'lib/utopia/controller.rb', line 36

def self.class_name_for_controller(controller)
	controller.uri_path.to_a.collect{|_| _.capitalize}.join + "_#{controller.object_id}"
end

.define(klass) ⇒ Object



40
41
42
43
44
45
# File 'lib/utopia/controller.rb', line 40

def self.define(klass)
	self.const_set(
		class_name_for_controller(klass),
		klass,
	)
end