class XSD::QName

Constants

EMPTY
NormalizedNameRegexp

Attributes

name[R]
namespace[R]
source[RW]

Public Class Methods

new(namespace = nil, name = nil) click to toggle source
# File lib/xsd/qname.rb, line 17
def initialize(namespace = nil, name = nil)
  @namespace = namespace
  @name = name
  @source = nil
end

Public Instance Methods

==(rhs) click to toggle source
# File lib/xsd/qname.rb, line 44
def ==(rhs)
  !rhs.nil? and @namespace == rhs.namespace and @name == rhs.name
end
===(rhs) click to toggle source
# File lib/xsd/qname.rb, line 48
def ===(rhs)
  (self == rhs)
end
dump(predefined_ns = nil) click to toggle source
# File lib/xsd/qname.rb, line 27
def dump(predefined_ns = nil)
  ns = predefined_ns
  ns ||= @namespace.nil? ? 'nil' : @namespace.dump
  name = @name.nil? ? 'nil' : @name.dump
  "XSD::QName.new(#{ns}, #{name})"
end
dup_name(name) click to toggle source
# File lib/xsd/qname.rb, line 23
def dup_name(name)
  XSD::QName.new(@namespace, name)
end
eql?(rhs) click to toggle source
# File lib/xsd/qname.rb, line 52
def eql?(rhs)
  (self == rhs)
end
hash() click to toggle source
# File lib/xsd/qname.rb, line 56
def hash
  @namespace.hash ^ @name.hash
end
inspect() click to toggle source
# File lib/xsd/qname.rb, line 64
def inspect
  sprintf("#<%s:0x%x %s>", self.class.name, __id__,
    "{#{ namespace }}#{ name }")
end
match(rhs) click to toggle source
# File lib/xsd/qname.rb, line 34
def match(rhs)
  if rhs.namespace and (rhs.namespace != @namespace)
    return false
  end
  if rhs.name and (rhs.name != @name)
    return false
  end
  true
end
parse(str) click to toggle source
# File lib/xsd/qname.rb, line 70
def parse(str)
  NormalizedNameRegexp =~ str
  self.new($1, $2)
end
to_s() click to toggle source
# File lib/xsd/qname.rb, line 60
def to_s
  "{#{ namespace }}#{ name }"
end