Class: Hyper::Application
- Inherits:
-
Object
- Object
- Hyper::Application
- Includes:
- Helper
- Defined in:
- lib/hyper/application.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
11 12 13 |
# File 'lib/hyper/application.rb', line 11 def request @request end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hyper/application.rb', line 13 def call(env) @request = Rack::Request.new(env) url = request.path layout = Utils.layout_path view = Utils.view_path(url) if File.file?(view) respond_with(200, rendered_templates(layout, view)) else respond_with(404, not_found(layout, url)) end end |