Class: Webmention::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/webmention/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, request) ⇒ Webmention::Response

Create a new Webmention::Response.

Instances of this class represent completed HTTP requests, the details of which may be accessed using the delegated #code and #reason) instance methods.

Parameters:



44
45
46
47
# File 'lib/webmention/response.rb', line 44

def initialize(response, request)
  @response = response
  @request = request
end

Instance Attribute Details

#requestWebmention::Request (readonly)

Returns:



8
9
10
# File 'lib/webmention/response.rb', line 8

def request
  @request
end

Instance Method Details

#:@responseString

Returns:

  • (String)


12
# File 'lib/webmention/response.rb', line 12

def_delegator :@response, :headers

#inspectString

:nocov:

Returns:

  • (String)


51
52
53
54
55
56
# File 'lib/webmention/response.rb', line 51

def inspect
  "#<#{self.class}:#{format("%#0x", object_id)} " \
    "code: #{code.inspect}, " \
    "reason: #{reason}, " \
    "url: #{request.uri}>"
end

#ok?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/webmention/response.rb', line 60

def ok?
  true
end