Class: BreezyPDF::Interceptor
- Inherits:
-
Object
- Object
- BreezyPDF::Interceptor
- Defined in:
- lib/breezy_pdf/interceptor.rb
Overview
Intercept a Rack request
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(app, env) ⇒ Interceptor
constructor
A new instance of Interceptor.
- #intercept! ⇒ Object
Constructor Details
#initialize(app, env) ⇒ Interceptor
Returns a new instance of Interceptor.
8 9 10 11 |
# File 'lib/breezy_pdf/interceptor.rb', line 8 def initialize(app, env) @app = app @env = env end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/breezy_pdf/interceptor.rb', line 6 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
6 7 8 |
# File 'lib/breezy_pdf/interceptor.rb', line 6 def env @env end |
Instance Method Details
#intercept! ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/breezy_pdf/interceptor.rb', line 13 def intercept! if intercept? BreezyPDF.logger.info("[BreezyPDF] Intercepting request for PDF rendering") intercept.new(@app, @env).call else app.call(env) end end |