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.
_callback | [RW] | |
_model | [RW] | |
_user | [RW] |
@return [true false] whether the current user is logged in. @api internal @see Ramaze::Helper::User#logged_in? @author manveru
@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
@see Ramaze::Helper::User#user_login @author manveru
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.