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::Custom

#oriinal_value

Attributes inherited from Value

#format, #type, #value

Class Method Summary collapse

Methods inherited from Value::Custom

#to_v1, #to_v2, #version

Methods inherited from Value

#==, #as_type, from, #initialize, #inspect, #method_missing, #respond_to_missing?, #stringify_value, #to_s, #to_v2, #version

Constructor Details

This class inherits a constructor from KDL::Value

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class KDL::Value

Class Method Details

.call(value, type = 'url') ⇒ Object



20
21
22
# File 'lib/kdl/types/url.rb', line 20

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

.parse_url(string) ⇒ Object



24
25
26
27
28
# File 'lib/kdl/types/url.rb', line 24

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