Class: Webmention::Response
- Inherits:
-
Object
- Object
- Webmention::Response
- Extended by:
- Forwardable
- Defined in:
- lib/webmention/response.rb
Instance Attribute Summary collapse
- #request ⇒ Webmention::Request readonly
Instance Method Summary collapse
- #:@response ⇒ String
-
#initialize(response, request) ⇒ Webmention::Response
constructor
Create a new Webmention::Response.
-
#inspect ⇒ String
:nocov:.
- #ok? ⇒ Boolean
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.
44 45 46 47 |
# File 'lib/webmention/response.rb', line 44 def initialize(response, request) @response = response @request = request end |
Instance Attribute Details
#request ⇒ Webmention::Request (readonly)
8 9 10 |
# File 'lib/webmention/response.rb', line 8 def request @request end |
Instance Method Details
#:@response ⇒ String
12 |
# File 'lib/webmention/response.rb', line 12 def_delegator :@response, :headers |
#inspect ⇒ String
:nocov:
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
60 61 62 |
# File 'lib/webmention/response.rb', line 60 def ok? true end |