class XSD::XSDQName

Constants

Type

Public Class Methods

new(value = nil) click to toggle source
# File lib/xsd/datatypes.rb, line 961
def initialize(value = nil)
  init(Type, value)
end

Private Instance Methods

_set(data) click to toggle source
# File lib/xsd/datatypes.rb, line 977
def _set(data)
  if data.nil?
    @prefix = @localpart = @data = nil
    return
  end
  @prefix, @localpart = data
  @data = _to_s
  @data.freeze
end
_to_s() click to toggle source
# File lib/xsd/datatypes.rb, line 987
def _to_s
  if @prefix
    "#{ @prefix }:#{ @localpart }"
  else
    "#{ @localpart }"
  end
end
screen_data(value) click to toggle source
# File lib/xsd/datatypes.rb, line 967
def screen_data(value)
  /^(?:([^:]+):)?([^:]+)$/ =~ value.to_s.strip
  unless Regexp.last_match
    raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
  end
  prefix = $1
  localpart = $2
  [prefix, localpart]
end