Class: Rack::Ketai::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/egalite/keitai/rack/ketai/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



3
4
5
# File 'lib/egalite/keitai/rack/ketai/middleware.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
# File 'lib/egalite/keitai/rack/ketai/middleware.rb', line 7

def call(env)
  carrier = Rack::Ketai::Carrier.load(env)
  return @app.call(env) unless carrier
  
  apply(env, carrier)
end