Class: BreezyPDFLite::Middleware

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

Overview

Rack Middleware for BreezyPDFLite Determines if the request should be intercepted or not

Instance Method Summary collapse

Constructor Details

#initialize(app, _options = {}) ⇒ Middleware

Returns a new instance of Middleware.



7
8
9
# File 'lib/breezy_pdf_lite/middleware.rb', line 7

def initialize(app, _options = {})
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/breezy_pdf_lite/middleware.rb', line 11

def call(env)
  if intercept?(env)
    Interceptor.new(@app, env).call
  else
    @app.call(env)
  end
end