Class: Rack::BackDoor

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/back_door.rb

Overview

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, &block) ⇒ BackDoor

Returns a new instance of BackDoor.



6
7
8
9
10
11
12
13
14
# File 'lib/rack/back_door.rb', line 6

def initialize(app, options = {}, &block)
  @app = app
  @url_parameter = options.fetch(:url_parameter, "as")
  @session_key = options.fetch(:session_key, "user_id")

  if block
    @sign_in = Proc.new(&block)
  end
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rack/back_door.rb', line 16

def call(env)
  @env = env

  

  app.call(env)
end