XSD::QName (Class)

In: xsd/qname.rb
Parent: Object

Methods

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

Constants

NormalizedNameRegexp = /^\{([^}]*)\}(.*)$/

Attributes

name  [RW] 
namespace  [RW] 

Public Class methods

[Source]

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

Public Instance methods

[Source]

# File xsd/qname.rb, line 38
  def ==(rhs)
    (self.class === rhs && @namespace == rhs.namespace && @name == rhs.name)
  end

[Source]

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

[Source]

# File xsd/qname.rb, line 21
  def dup_name(name)
    self.class.new(@namespace, name)
  end

[Source]

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

[Source]

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

[Source]

# File xsd/qname.rb, line 25
  def match(rhs)
    unless self.class === rhs
      return false
    end
    if rhs.namespace and (rhs.namespace != @namespace)
      return false
    end
    if rhs.name and (rhs.name != @name)
      return false
    end
    true
  end

[Source]

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

[Source]

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

[Validate]