Class: KDL::Types::URL

Inherits:
URLReference show all
Defined in:
lib/kdl/types/url.rb

Constant Summary

Constants inherited from Value

Value::Null

Instance Attribute Summary

Attributes inherited from Value

#format, #type, #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') ⇒ Object



18
19
20
# File 'lib/kdl/types/url.rb', line 18

def self.call(value, type = 'url')
  super(value, type)
end

.parse_url(string) ⇒ Object



22
23
24
25
26
# File 'lib/kdl/types/url.rb', line 22

def self.parse_url(string)
  super.tap do |uri|
    raise 'invalid URL' if uri.scheme.nil?
  end
end