Class: XML::MappingExtensions::UriNode

Inherits:
NodeBase
  • Object
show all
Defined in:
lib/xml/mapping_extensions/uri_node.rb

Overview

Coverts URI strings to URI objects.

Instance Method Summary collapse

Methods inherited from NodeBase

#extract_attr_value, #initialize, #set_attr_value, #to_xml_text

Constructor Details

This class inherits a constructor from XML::MappingExtensions::NodeBase

Instance Method Details

#to_value(xml_text) ⇒ URI

Returns the URI.

Parameters:

  • xml_text (String)

    the URI string to convert

Returns:

  • (URI)

    the URI

Raises:

  • (URI::InvalidURIError)

    if xml_text is not a valid URI.



12
13
14
# File 'lib/xml/mapping_extensions/uri_node.rb', line 12

def to_value(xml_text)
  URI(xml_text.strip)
end