Class: KDL::Types::URLReference
Direct Known Subclasses
Constant Summary
Constants inherited from Value
Instance Attribute Summary
Attributes inherited from Value
Class Method Summary collapse
Methods inherited from Value
#as_type, from, #initialize, #stringify_value, #to_s
Constructor Details
This class inherits a constructor from KDL::Value
Class Method Details
.call(value, type = 'url-reference') ⇒ Object
4 5 6 7 8 9 |
# File 'lib/kdl/types/url.rb', line 4 def self.call(value, type = 'url-reference') return nil unless value.is_a? ::KDL::Value::String uri = parse_url(value.value) new(uri, type: type) end |
.parse_url(string) ⇒ Object
11 12 13 |
# File 'lib/kdl/types/url.rb', line 11 def self.parse_url(string) URI.parse(string) end |