Sha256: 11133460b63b8595c80cbf1a968ab2688918195a9f85c5bed1c09bb4c7566412

Contents?: true

Size: 807 Bytes

Versions: 7

Compression:

Stored size: 807 Bytes

Contents

# encoding: utf-8
module Warden
  module Mixins
    module Common

      # Convinience method to access the session
      # :api: public
      def session
        env['rack.session']
      end # session
      alias_method :raw_session, :session

      # Convenience method to access the rack request
      # :api: public
      def request
        @request ||= Rack::Request.new(@env)
      end # request

      # Convenience method to access the rack request params
      # :api: public
      def params
        request.params
      end # params

      # Resets the session.  By using this non-hash like sessions can
      # be cleared by overwriting this method in a plugin
      # @api overwritable
      def reset_session!
        raw_session.clear
      end
    end # Common
  end # Mixins
end # Warden

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
hassox-warden-0.3.2 lib/warden/mixins/common.rb
warden-0.5.3 lib/warden/mixins/common.rb
warden-0.5.2 lib/warden/mixins/common.rb
warden-0.5.1 lib/warden/mixins/common.rb
warden-0.5.0 lib/warden/mixins/common.rb
warden-0.4.0 lib/warden/mixins/common.rb
warden-0.3.2 lib/warden/mixins/common.rb