Class Waves::Session
In: lib/runtime/session.rb
Parent: Object

Encapsulates the session associated with a given request. A session has an expiration and path, which must be provided in a Waves::Configuration. Sensible defaults are defined in Waves::Configurations::Default

Methods

[]   []=   new   to_hash  

Public Class methods

Create a new session object using the given request. This is not necessarily the same as constructing a new session. See Rack::Sesssion for more info.

[Source]

    # File lib/runtime/session.rb, line 11
11:     def initialize( request )
12:       @data = request.rack_request.env['rack.session']
13:     end

Public Instance methods

Access a given data element of the session using the given key.

[Source]

    # File lib/runtime/session.rb, line 19
19:     def [](key) ; @data[key] ; end

Set the given data element of the session using the given key and value.

[Source]

    # File lib/runtime/session.rb, line 21
21:     def []=(key,val) ; @data[key] = val ; end

Return the session data as a hash

[Source]

    # File lib/runtime/session.rb, line 16
16:     def to_hash ; @data ; end

[Validate]