def user(argument = {})
      opts  = argument.is_a?(Hash) ? argument : { :scope => argument }
      scope = (opts[:scope] ||= @config.default_scope)

      if @users.has_key?(scope)
        @users[scope]
      else
        unless user = session_serializer.fetch(scope)
          run_callbacks = opts.fetch(:run_callbacks, true)
          manager._run_callbacks(:after_failed_fetch, user, self, :scope => scope) if run_callbacks
        end

        @users[scope] = user ? set_user(user, opts.merge(:event => :fetch)) : nil
      end
    end
def user(argument = {})
      opts  = argument.is_a?(Hash) ? argument : { :scope => argument }
      scope = (opts[:scope] ||= @config.default_scope)

      if @users.has_key?(scope)
        @users[scope]
      else
        unless user = session_serializer.fetch(scope)
          run_callbacks = opts.fetch(:run_callbacks, true)
          manager._run_callbacks(:after_failed_fetch, user, self, :scope => scope) if run_callbacks
        end

        @users[scope] = user ? set_user(user, opts.merge(:event => :fetch)) : nil
      end
    end
Provides access to the user object in a given scope for a request.
 Will be nil if not logged in. Please notice that this method does not
 perform strategies.

 Example:
   # without scope (default user)
   env['warden'].user

   # with scope
   env['warden'].user(:admin)

   # as a Hash
   env['warden'].user(:scope => :admin)

   # with default scope and run_callbacks option
   env['warden'].user(:run_callbacks => false)

  # with a scope and run_callbacks option
  env['warden'].user(:scope => :admin, :run_callbacks => true)

 :api: public