Class Ramaze::Helper::UserHelper::Wrapper
In: lib/ramaze/helper/user.rb
Parent: BlankSlate

Wrapper for the ever-present "user" in your application. It wraps around an arbitrary instance and worries about authentication and storing information about the user in the session.

In order to not interfere with the wrapped instance/model we start our methods with an underscore.

Patches and suggestions are highly appreciated.

Methods

Attributes

_callback  [RW] 
_model  [RW] 
_user  [RW] 

Public Class methods

Public Instance methods

@author manveru @api internal @see Ramaze::Helper::User#logged_in? @return [true false] whether the current user is logged in.

@author manveru @see Ramaze::Helper::User#user_login @param [Hash] creds this hash will be stored in the session on

 successful login

@return [Ramaze::Helper::User::Wrapper] wrapped return value from

 model or callback

@author manveru @api internal @see Ramaze::Helper::User#user_logout

The callback should return an instance of the user, otherwise it should answer with nil.

This will not actually login, just check whether the credentials would result in a user.

Refer everything not known THINK: This might be quite confusing… should we raise instead?

[Validate]