<

All Slice code is expected to be namespaced inside a module


All Slice code is expected to be namespaced inside a module


All Slice code is expected to be namespaced inside a module

Public Class Methods

activate() click to toggle source

Activation hook - runs after AfterAppLoads BootLoader

# File lib/generators/templates/very_thin/lib/%base_name%.rb, line 32
def self.activate
end
deactivate() click to toggle source

Deactivation hook - triggered by Merb::Slices.deactivate(<%= module_name %>)

# File lib/generators/templates/very_thin/lib/%base_name%.rb, line 36
def self.deactivate
end
init() click to toggle source

Initialization hook - runs before AfterAppLoads BootLoader

# File lib/generators/templates/very_thin/lib/%base_name%.rb, line 28
def self.init
end
loaded() click to toggle source

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

# File lib/generators/templates/very_thin/lib/%base_name%.rb, line 24
def self.loaded
end
setup_default_structure!() click to toggle source

This sets up a very thin slice’s structure.

# File lib/generators/templates/very_thin/lib/%base_name%.rb, line 54
def self.setup_default_structure!
  self.push_app_path(:root, Merb.root / 'slices' / self.identifier, nil)
  
  self.push_path(:stub, root_path('stubs'), nil)
  self.push_app_path(:stub, app_dir_for(:root), nil)
  
  self.push_path(:application, root, 'application.rb')
  self.push_app_path(:application, app_dir_for(:root), 'application.rb')
        
  self.push_path(:public, root_path('public'), nil)
  self.push_app_path(:public, Merb.root / 'public' / 'slices' / self.identifier, nil)
  
  public_components.each do |component|
    self.push_path(component, dir_for(:public) / "#{component}s", nil)
    self.push_app_path(component, app_dir_for(:public) / "#{component}s", nil)
  end
end
setup_router(scope) click to toggle source

Setup routes inside the host application

@param 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.

@note prefix your named routes with :<%= symbol_name %>_

to avoid potential conflicts with global named routes.
# File lib/generators/templates/very_thin/lib/%base_name%.rb, line 48
def self.setup_router(scope)
  # enable slice-level default routes by default
  scope.default_routes
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.