In Files

  • xsd/qname.rb

Class/Module Index [+]

Quicksearch

XSD::QName

Attributes

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

Public Class Methods

new(namespace = nil, name = nil) click to toggle source
 
               # File 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 xsd/qname.rb, line 43
def ==(rhs)
  !rhs.nil? and @namespace == rhs.namespace and @name == rhs.name
end
            
===(rhs) click to toggle source
 
               # File xsd/qname.rb, line 47
def ===(rhs)
  (self == rhs)
end
            
dump() click to toggle source
 
               # File xsd/qname.rb, line 27
def dump
  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 xsd/qname.rb, line 23
def dup_name(name)
  XSD::QName.new(@namespace, name)
end
            
eql?(rhs) click to toggle source
 
               # File xsd/qname.rb, line 51
def eql?(rhs)
  (self == rhs)
end
            
hash() click to toggle source
 
               # File xsd/qname.rb, line 55
def hash
  @namespace.hash ^ @name.hash
end
            
inspect() click to toggle source
 
               # File xsd/qname.rb, line 63
def inspect
  sprintf("#<%s:0x%x %s>", self.class.name, __id__,
    "{#{ namespace }}#{ name }")
end
            
match(rhs) click to toggle source
 
               # File xsd/qname.rb, line 33
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 xsd/qname.rb, line 69
def parse(str)
  NormalizedNameRegexp =~ str
  self.new($1, $2)
end
            
to_s() click to toggle source
 
               # File xsd/qname.rb, line 59
def to_s
  "{#{ namespace }}#{ name }"
end