Sha256: f6fa76ab6d1eae664f684aa7881822725914397592e0201c56f2d362fa3e6710

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

require 'rubygems'
require 'bundler/setup'

require 'rack'

module RubyApp

  module Rack

    class Session

      def initialize(application, _class)
        @application = application
        @_class = _class
      end

      def call(environment)
        request = ::Rack::Request.new(environment)
        session = ( request.session[:session] ||= @_class.new(request) )
        session.begin_request(request)
        begin
          @application.call(environment)
        ensure
          session.end_request
        end
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
_rubyapp-0.0.3 lib/rubyapp/rack/session.rb