Class: Rack::Passport

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Passport

Returns a new instance of Passport.



13
14
15
16
# File 'lib/passport/passport.rb', line 13

def initialize(app)
  @app = app
  self.middleware = [::Rack::Context.new(app), ::Passport::Filter.new(app)]
end

Instance Attribute Details

#middlewareObject

Returns the value of attribute middleware.



11
12
13
# File 'lib/passport/passport.rb', line 11

def middleware
  @middleware
end

Instance Method Details

#call(env) ⇒ Object



18
19
20
21
# File 'lib/passport/passport.rb', line 18

def call(env)
  self.middleware.each { |ware| ware.call(env) }
  @app.call(env)
end