lib/indieweb/endpoints/parsers.rb in indieweb-endpoints-0.1.0 vs lib/indieweb/endpoints/parsers.rb in indieweb-endpoints-0.2.0
- old
+ new
@@ -48,11 +48,11 @@
def link_elements
@link_elements ||= doc.css(link_elements_css_selector)
end
def link_elements_css_selector
- @link_elements_css_selector ||= %(link[rel~="#{identifier}"][href])
+ @link_elements_css_selector ||= %(link[rel~="#{self.class.identifier}"][href])
end
def link_header
@link_header ||= link_headers.shift
end
@@ -63,10 +63,10 @@
end
def regexp_rel_paramater_pattern
# Ultra-orthodox pattern matching Link header `rel` parameter including a matching identifier value
# https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint
- @regexp_rel_paramater_pattern ||= /(?:;|\s)rel="?(?:#{REGEXP_REG_REL_TYPE_PATTERN}+\s)?#{identifier}(?:\s#{REGEXP_REG_REL_TYPE_PATTERN})?"?/
+ @regexp_rel_paramater_pattern ||= /(?:;|\s)rel="?(?:#{REGEXP_REG_REL_TYPE_PATTERN}+\s)?#{self.class.identifier}(?:\s#{REGEXP_REG_REL_TYPE_PATTERN})?"?/
end
def results_from_body
link_element['href'] if response_is_html && link_element
end