Class: RenderStatic::Middleware
- Inherits:
-
Object
- Object
- RenderStatic::Middleware
- Defined in:
- lib/render_static/middleware.rb
Class Attribute Summary collapse
-
.base_path ⇒ Object
Returns the value of attribute base_path.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
13 14 15 |
# File 'lib/render_static/middleware.rb', line 13 def initialize(app) @app = app end |
Class Attribute Details
.base_path ⇒ Object
Returns the value of attribute base_path.
10 11 12 |
# File 'lib/render_static/middleware.rb', line 10 def base_path @base_path end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/render_static/middleware.rb', line 17 def call(env) if will_render?(env) RenderStatic::Renderer.render(env) else @app.call(env) end end |