Module: Lydia::StandardPages
- Included in:
- Router
- Defined in:
- lib/lydia/standard_pages.rb
Instance Method Summary collapse
- #halted(_env = nil) ⇒ Object
- #internal_server_error(_env = nil, exception = nil) ⇒ Object
- #not_found(env = nil) ⇒ Object
Instance Method Details
#halted(_env = nil) ⇒ Object
13 14 15 16 |
# File 'lib/lydia/standard_pages.rb', line 13 def halted(_env = nil) = "<html><body><h1>Application halted</h1></body></html>" [500, {'Content-Type' => 'text/html', 'Content-Length' => .length.to_s}, []] end |
#internal_server_error(_env = nil, exception = nil) ⇒ Object
8 9 10 11 |
# File 'lib/lydia/standard_pages.rb', line 8 def internal_server_error(_env = nil, exception = nil) = "<html><body><h1>Internal server error</h1><p>#{exception}</p></body></html>" [500, {'Content-Type' => 'text/html', 'Content-Length' => .length.to_s}, []] end |
#not_found(env = nil) ⇒ Object
3 4 5 6 |
# File 'lib/lydia/standard_pages.rb', line 3 def not_found(env = nil) = "<html><body><h1>Not Found</h1><p>No route matches #{env['REQUEST_METHOD']} #{env['PATH_INFO']}</p></body></html>" [404, {'Content-Type' => 'text/html', 'Content-Length' => .length.to_s}, []] end |