Sha256: 40dbb5a5a82ae2cc8340d9dbc32b14ac93aea3fee24559fdd3ee55098625ad62

Contents?: true

Size: 654 Bytes

Versions: 7

Compression:

Stored size: 654 Bytes

Contents

require 'rack/session/abstract/id'
require 'rack_datamapper/session/abstract/store'

module DataMapper
  module Session
    class Datamapper < ::Rack::Session::Abstract::ID
      
      def initialize(app, options = {})
        super
        id_generator = Proc.new do 
          generate_sid
        end
        @store = ::DataMapper::Session::Abstract::Store.new(app, options, id_generator)
      end
      
      private

      def get_session(env, sid)
        @store.get_session(env, sid)
      end
      
      def set_session(env, sid, session_data, options)
        @store.set_session(env, sid, session_data, options)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rack-datamapper-0.3.3 lib/rack_datamapper/session/datamapper.rb
rack-datamapper-0.3.2 lib/rack_datamapper/session/datamapper.rb
rack-datamapper-0.2.6 lib/rack_datamapper/session/datamapper.rb
rack-datamapper-0.2.5 lib/rack_datamapper/session/datamapper.rb
rack-datamapper-0.2.4 lib/rack_datamapper/session/datamapper.rb
rack-datamapper-0.2.3 lib/rack_datamapper/session/datamapper.rb
rack-datamapper-0.2.2 lib/rack_datamapper/session/datamapper.rb