Class: Ki::Middleware::HamlCompiler

Inherits:
Object
  • Object
show all
Includes:
Helpers::HamlCompiler, BaseMiddleware
Defined in:
lib/ki/middleware/haml_compiler.rb

Direct Known Subclasses

InstaDoc

Instance Method Summary collapse

Methods included from BaseMiddleware

#initialize

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/ki/middleware/haml_compiler.rb', line 9

def call(env)
  req = BaseRequest.new env
  if view_exists?(req)
    html = render_haml_file view_path(req)
    Rack::Response.new(html).finish
  else
    @app.call env
  end
end