All Slice code is expected to be namespaced inside a module
Activation hook - runs after AfterAppLoads BootLoader
# File lib/merb-auth-slice-password.rb, line 45 def self.activate # Load the default strategies end
Deactivation hook - triggered by Merb::Slices.deactivate(MerbAuthSlicePassword)
# File lib/merb-auth-slice-password.rb, line 50 def self.deactivate end
Initialization hook - runs before AfterAppLoads BootLoader
# File lib/merb-auth-slice-password.rb, line 37 def self.init require "merb-auth-more/mixins/redirect_back" unless ::Merb::Slices::config[:"merb-auth-slice-password"][:no_default_strategies] ::Merb::Authentication.activate!(:default_password_form) end end
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
# File lib/merb-auth-slice-password.rb, line 33 def self.loaded end
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 :mauth_password_slice_
to avoid potential conflicts with global named routes.
# File lib/merb-auth-slice-password.rb, line 62 def self.setup_router(scope) # example of a named route scope.match("/login", :method => :get ).to(:controller => "/exceptions", :action => "unauthenticated").name(:login) scope.match("/login", :method => :put ).to(:controller => "sessions", :action => "update" ).name(:perform_login) scope.match("/logout" ).to(:controller => "sessions", :action => "destroy" ).name(:logout) end
Generated with the Darkfish Rdoc Generator 2.