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
16 17 18 19 |
# File 'lib/lydia/standard_pages.rb', line 16 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
11 12 13 14 |
# File 'lib/lydia/standard_pages.rb', line 11 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 7 8 9 |
# 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 |