Class: RenderStatic::Middleware

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

Class Attribute Summary collapse

Instance Method Summary collapse

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_pathObject

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