Class: WackyCanvas::RackAuthorize

Inherits:
Object
  • Object
show all
Defined in:
lib/wacky_canvas/rack_authorize.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RackAuthorize

Returns a new instance of RackAuthorize.



3
4
5
# File 'lib/wacky_canvas/rack_authorize.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  session = WackyCanvas::Session.new(env)
  env[:wacky_canvas] = session
  response = @app.call(env)
  session.add_remember_cookie(response[1])
  response
end