123456789_123456789_123456789_123456789_123456789_

Class: YARD::Server::WebrickServlet

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, WEBrick::HTTPServlet::AbstractServlet
Instance Chain:
self, WEBrick::HTTPServlet::AbstractServlet
Inherits: WEBrick::HTTPServlet::AbstractServlet
  • Object
Defined in: lib/yard/server/webrick_adapter.rb

Overview

The main WEBrick servlet implementation, accepting only GET requests.

Since:

  • 0.6.0

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(server, adapter) ⇒ WebrickServlet

Since:

  • 0.6.0

[ GitHub ]

  
# File 'lib/yard/server/webrick_adapter.rb', line 23

def initialize(server, adapter)
  super
  self.adapter = adapter
end

Instance Attribute Details

#adapter (rw)

Since:

  • 0.6.0

[ GitHub ]

  
# File 'lib/yard/server/webrick_adapter.rb', line 21

attr_accessor :adapter

Instance Method Details

#do_GET(request, response)

This method is for internal use only.

Since:

  • 0.6.0

[ GitHub ]

  
# File 'lib/yard/server/webrick_adapter.rb', line 29

def do_GET(request, response) # rubocop:disable Style/MethodName
  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