Module: Lydia::StandardPages

Included in:
Router
Defined in:
lib/lydia/standard_pages.rb

Instance Method Summary collapse

Instance Method Details

#halted(_env = nil) ⇒ Object



13
14
15
16
# File 'lib/lydia/standard_pages.rb', line 13

def halted(_env = nil)
  message = "<html><body><h1>Application halted</h1></body></html>"
  [500, {'Content-Type' => 'text/html', 'Content-Length' => message.length.to_s}, [message]]            
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)
  message = "<html><body><h1>Internal server error</h1><p>#{exception}</p></body></html>"
  [500, {'Content-Type' => 'text/html', 'Content-Length' => message.length.to_s}, [message]]      
end

#not_found(env = nil) ⇒ Object



3
4
5
6
# File 'lib/lydia/standard_pages.rb', line 3

def not_found(env = nil)
  message = "<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' => message.length.to_s}, [message]]
end