class Gem::GemcutterUtilities::WebauthnListener::Response

Attributes

http_response [R]

Public Class Methods

for (host)
# File lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb, line 31
def self.for(host)
  new(host)
end
new (host)
# File lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb, line 35
def initialize(host)
  @host = host

  build_http_response
end

Public Instance Methods

to_s ()
# File lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb, line 41
def to_s
  status_line = "HTTP/#{@http_response.http_version} #{@http_response.code} #{@http_response.message}\r\n"
  headers = @http_response.to_hash.map {|header, value| "#{header}: #{value.join(", ")}\r\n" }.join + "\r\n"
  body = @http_response.body ? "#{@http_response.body}\n" : ""

  status_line + headers + body
end