Class: LinkChecker::Async::HTTP::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-link-checker/async/http/result.rb

Overview

Wraps an Async::HTTP response to expose a code and case-insensitive headers, similar to the other checkers' response objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



22
23
24
25
# File 'lib/ruby-link-checker/async/http/result.rb', line 22

def initialize(response)
  @status = response.status
  @headers = Headers.new(response.headers)
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



20
21
22
# File 'lib/ruby-link-checker/async/http/result.rb', line 20

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



20
21
22
# File 'lib/ruby-link-checker/async/http/result.rb', line 20

def status
  @status
end

Instance Method Details

#codeObject



27
28
29
# File 'lib/ruby-link-checker/async/http/result.rb', line 27

def code
  @status.to_s
end