Class: OddJob::Info

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Includes:
HtmlRender
Defined in:
lib/oddjob.rb

Overview

Webrick servlet for creating the information page.

Instance Method Summary collapse

Methods included from HtmlRender

#page

Constructor Details

#initialize(server, cmd_usage, *options) ⇒ Info

Standard servlet initialization function with an additional cmd_usage argument for specifying the command line usage of the OddJob module’s calling entity.



133
134
135
136
# File 'lib/oddjob.rb', line 133

def initialize(server, cmd_usage, *options)
  @usage = cmd_usage
  super(server, options)
end

Instance Method Details

#do_GET(request, response) ⇒ Object

Respond to get request, returns informational page.



140
141
142
143
144
# File 'lib/oddjob.rb', line 140

def do_GET(request, response)
  response.status = 200
  response['Content-Type'] = "text/html"
  response.body = info_page
end