Class: TranslationEngine::ScreenshotsMiddleware
- Inherits:
-
Object
- Object
- TranslationEngine::ScreenshotsMiddleware
- Includes:
- Request
- Defined in:
- app/middlewares/translation_engine/screenshots_middleware.rb
Constant Summary collapse
- URL_PATH =
/\A\/translation_engine\/screenshots/
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ScreenshotsMiddleware
constructor
A new instance of ScreenshotsMiddleware.
Methods included from Request
Constructor Details
#initialize(app) ⇒ ScreenshotsMiddleware
Returns a new instance of ScreenshotsMiddleware.
7 8 9 |
# File 'app/middlewares/translation_engine/screenshots_middleware.rb', line 7 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/middlewares/translation_engine/screenshots_middleware.rb', line 11 def call(env) if TranslationEngine.use_screenshots && env['PATH_INFO'] =~ URL_PATH handle_translation_request(env) else @app.call(env) end end |