Method: Nokogiri::XML::Node#uri
- Defined in:
- lib/ryoba/nokogiri/xml/node.rb
#uri(attribute_name = nil) ⇒ URI?
Builds a URI from a specified attribute. If no attribute is specified, an element-appropriate attribute will be chosen from HTML_ELEMENT_URI_ATTRIBUTES, if possible. Relative URIs will be converted to absolute URIs using the Node document’s url
, if possible.
118 119 120 121 122 |
# File 'lib/ryoba/nokogiri/xml/node.rb', line 118 def uri(attribute_name = nil) attribute_name ||= HTML_ELEMENT_URI_ATTRIBUTES[self.name] url = self[attribute_name] URI.join(*self.document.url, url) if url end |