Class: SDL::Types::SDLUrl

Inherits:
SDLSimpleType show all
Includes:
SDLType
Defined in:
lib/sdl/types/sdl_url.rb,
lib/sdl/exporters/xml_mapping.rb

Instance Attribute Summary

Attributes inherited from SDLSimpleType

#parent, #parent_index, #raw_value, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SDLType

codes, included, #xml_attributes, #xml_value

Methods inherited from SDLSimpleType

#==, #annotated?, #annotations, #initialize, #initialize_value, #to_s

Constructor Details

This class inherits a constructor from SDL::Types::SDLSimpleType

Class Method Details

.xml_typeObject



74
75
76
# File 'lib/sdl/exporters/xml_mapping.rb', line 74

def self.xml_type
  'ns:anyURI'
end

Instance Method Details

#from_string(string_value) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/sdl/types/sdl_url.rb', line 9

def from_string(string_value)
  begin
    @value = URI.parse string_value
  rescue URI::InvalidURIError
    throw "Invalid URI: #{string_value}"
  end
end