Sha256: e37112282815e23ceaa85a92d1970824e7e32463f66d496d10e8b7fac252a5c1

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

module Waves

  # 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
  
  class Session

    # 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.
    def initialize( request )
      @data = request.rack_request.env['rack.session']
    end
    
    # Return the session data as a hash
    def to_hash ; @data ; end
    
    # Access a given data element of the session using the given key.
    def [](key) ; @data[key] ; end
    # Set the given data element of the session using the given key and value.
    def []=(key,val) ; @data[key] = val ; end


  end

end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
dyoder-waves-0.8.0 lib/runtime/session.rb
waves-edge-2009.03.10.13.14 lib/runtime/session.rb
waves-stable-2009.3.10 lib/runtime/session.rb
waves-0.8.2 lib/runtime/session.rb
waves-0.8.1 lib/runtime/session.rb
waves-0.8.0 lib/runtime/session.rb