Class: Intra::RackSession

Inherits:
Object
  • Object
show all
Defined in:
lib/intra/rack_session.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RackSession

Returns a new instance of RackSession.



3
4
5
# File 'lib/intra/rack_session.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/intra/rack_session.rb', line 7

def call(env)
  session = Session.new env
  env[:intra] = session
  response = @app.call env
  session.add_cookie_to_headers response[1]
  response
end