Class: Raw::Controller

Inherits:
Object
  • Object
show all
Includes:
Publishable
Defined in:
lib/raw/controller.rb,
lib/raw/scaffold/controller.rb

Overview

The Controller part in the MVC paradigm. The controller’s published methods are called actrions. The controller class contains the Publishable mixin and additional helper mixins.

Class Method Summary collapse

Methods included from Publishable

included, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Raw::Publishable

Class Method Details

.currentObject

Returns the current controller from the context thread local variable.



20
21
22
# File 'lib/raw/controller.rb', line 20

def self.current
  Thread.current[:CURRENT_CONTROLLER] 
end

.mounted(path) ⇒ Object

This callback is called after the Controller is mounted.



14
15
# File 'lib/raw/controller.rb', line 14

def self.mounted(path)
end

.replace_current(controller) ⇒ Object

– Replaces the current controller (helper for render). This is an internal method. ++



29
30
31
32
33
# File 'lib/raw/controller.rb', line 29

def self.replace_current(controller) # :nodoc:
  old = Thread.current[:CURRENT_CONTROLLER]
  Thread.current[:CURRENT_CONTROLLER] = controller
  return old
end