Class: Webmention::ErrorResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/webmention/error_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, request) ⇒ Webmention::ErrorResponse

Create a new Webmention::ErrorResponse.

Instances of this class represent HTTP requests that generated errors (e.g. connection error, SSL error) or that could not locate a Webmention endpoint. The nature of the error is captured in the #message instance method.

Parameters:



22
23
24
25
# File 'lib/webmention/error_response.rb', line 22

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

Instance Attribute Details

#messageString (readonly)

Returns:

  • (String)


6
7
8
# File 'lib/webmention/error_response.rb', line 6

def message
  @message
end

#requestWebmention::Request (readonly)

Returns:



9
10
11
# File 'lib/webmention/error_response.rb', line 9

def request
  @request
end

Instance Method Details

#inspectString

:nocov:

Returns:

  • (String)


29
30
31
32
# File 'lib/webmention/error_response.rb', line 29

def inspect
  "#<#{self.class}:#{format("%#0x", object_id)} " \
    "message: #{message}>"
end

#ok?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/webmention/error_response.rb', line 36

def ok?
  false
end