Class: YARD::Server::WebrickServlet
- Inherits:
-
WEBrick::HTTPServlet::AbstractServlet
- Object
- WEBrick::HTTPServlet::AbstractServlet
- YARD::Server::WebrickServlet
- Defined in:
- lib/yard/server/webrick_adapter.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary collapse
- #do_GET(request, response) ⇒ Object
-
#initialize(server, adapter) ⇒ WebrickServlet
constructor
A new instance of WebrickServlet.
Constructor Details
#initialize(server, adapter) ⇒ WebrickServlet
Returns a new instance of WebrickServlet.
18 19 20 21 |
# File 'lib/yard/server/webrick_adapter.rb', line 18 def initialize(server, adapter) super self.adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object
16 17 18 |
# File 'lib/yard/server/webrick_adapter.rb', line 16 def adapter @adapter end |
Instance Method Details
#do_GET(request, response) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/yard/server/webrick_adapter.rb', line 23 def do_GET(request, response) status, headers, body = *adapter.router.call(request) response.status = status response.body = body.is_a?(Array) ? body[0] : body headers.each do |key, value| response[key] = value end end |