Sha256: 161c67c7c1a482af0695e1c5a4ea04122a1d2d2bcd50b2e4568baa4c6064763c
Contents?: true
Size: 444 Bytes
Versions: 22
Compression:
Stored size: 444 Bytes
Contents
require_relative 'node_base' require 'uri' module XML module MappingExtensions # Coverts URI strings to `URI` objects. class UriNode < NodeBase # @param xml_text [String] the URI string to convert # @return [URI] the URI # @raise [URI::InvalidURIError] if `xml_text` is not a valid URI. def to_value(xml_text) URI(xml_text.strip) end end ::XML::Mapping.add_node_class UriNode end end
Version data entries
22 entries across 22 versions & 1 rubygems