Class: Nokogiri::XML::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/ryoba/nokogiri/xml/document.rb

Instance Method Summary collapse

Instance Method Details

#uriURI?

Constructs a URI from the document’s url if url is not nil.

Examples:

xml = Nokogiri::XML(<<-XML, "https://www.example.com/foo")
  <body>FOO</body>
XML

xml.uri  # == URI("https://www.example.com/foo")

Returns:

  • (URI, nil)


15
16
17
# File 'lib/ryoba/nokogiri/xml/document.rb', line 15

def uri
  URI(url) if url
end