Module: MerbScrewUnit

Defined in:
lib/merb_screw_unit.rb

Overview

All Slice code is expected to be namespaced inside a module

Defined Under Namespace

Classes: Application, Main

Class Method Summary collapse

Class Method Details

.activateObject

Activation hook - runs after AfterAppLoads BootLoader



43
44
# File 'lib/merb_screw_unit.rb', line 43

def self.activate
end

.deactivateObject

Deactivation hook - triggered by Merb::Slices.deactivate(MerbScrewUnit)



47
48
# File 'lib/merb_screw_unit.rb', line 47

def self.deactivate
end

.initObject

Initialization hook - runs before AfterAppLoads BootLoader



39
40
# File 'lib/merb_screw_unit.rb', line 39

def self.init
end

.loadedObject

Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.



35
36
# File 'lib/merb_screw_unit.rb', line 35

def self.loaded
end

.setup_router(scope) ⇒ Object

Note:

prefix your named routes with :merb_screw_unit_ to avoid potential conflicts with global named routes.

Setup routes inside the host application

Parameters:

  • scope (Merb::Router::Behaviour)

    Routes will be added within this scope (namespace). In fact, any router behaviour is a valid namespace, so you can attach routes at any level of your router setup.



59
60
61
62
63
# File 'lib/merb_screw_unit.rb', line 59

def self.setup_router(scope)
  # example of a named route
  scope.match('/index.:format').to(:controller => 'main', :action => 'index').name(:merb_screw_unit_index)
  scope.match('/:controller/:action')
end