Class | XSD::QName
In: | xsd/qname.rb
Parent: | Object

### Methods

== === dump dup_name eql? hash inspect match new parse to_s

### Constants

NormalizedNameRegexp | = | /^\{([^}]*)\}(.*)$/
EMPTY | = | QName.new.freeze

### Attributes

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

### Public Class methods

new(namespace = nil, name = nil)

[Source]

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

### Public Instance methods

==(rhs)

[Source]

    # File xsd/qname.rb, line 43
      def ==(rhs)
        !rhs.nil? and @namespace == rhs.namespace and @name == rhs.name
      end

===(rhs)

[Source]

    # File xsd/qname.rb, line 47
      def ===(rhs)
        (self == rhs)
      end

dump()

[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)

[Source]

    # File xsd/qname.rb, line 23
      def dup_name(name)
        XSD::QName.new(@namespace, name)
      end

eql?(rhs)

[Source]

    # File xsd/qname.rb, line 51
      def eql?(rhs)
        (self == rhs)
      end

hash()

[Source]

    # File xsd/qname.rb, line 55
      def hash
        @namespace.hash ^ @name.hash
      end

inspect()

[Source]

    # File xsd/qname.rb, line 63
      def inspect
        sprintf("#<%s:0x%x %s>", self.class.name, __id__,
          "{#{ namespace }}#{ name }")
      end

match(rhs)

[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)

[Source]

    # File xsd/qname.rb, line 69
      def parse(str)
        NormalizedNameRegexp =~ str
        self.new($1, $2)
      end

to_s()

[Source]

    # File xsd/qname.rb, line 59
      def to_s
        "{#{ namespace }}#{ name }"
      end

[Validate]