Class: Webmention::Verification::Verifiers::BaseVerifier
- Inherits:
-
Object
- Object
- Webmention::Verification::Verifiers::BaseVerifier
show all
- Defined in:
- lib/webmention/verification/verifiers.rb
Instance Method Summary
collapse
Constructor Details
#initialize(response, target, **options) ⇒ BaseVerifier
Returns a new instance of BaseVerifier.
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/webmention/verification/verifiers.rb', line 7
def initialize(response, target, **options)
raise ArgumentError, "response must be an HTTP::Response (given #{response.class.name})" unless response.is_a?(HTTP::Response)
raise ArgumentError, "target must be a String (given #{target.class.name})" unless target.is_a?(String)
@response = response
@target = target
@options = options
raise UnsupportedMimeTypeError, "Unsupported MIME Type: #{response.mime_type}" unless self.class.mime_types.include?(response.mime_type)
end
|
Instance Method Details
#results ⇒ Object
18
19
20
|
# File 'lib/webmention/verification/verifiers.rb', line 18
def results
@results ||= parse_response_body
end
|
#verified? ⇒ Boolean
22
23
24
|
# File 'lib/webmention/verification/verifiers.rb', line 22
def verified?
results.any?
end
|