Class: REXML::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/xml/util/xmlcanonicalizer.rb

Instance Method Summary collapse

Instance Method Details

#<=>(a2) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/xml/util/xmlcanonicalizer.rb', line 23

def <=>(a2)
  if (self === a2)
    return 0
  elsif (self == nil)
    return -1
  elsif (a2 == nil)
    return 1
  elsif (self.prefix() == a2.prefix())
    return self.name()<=>a2.name()
  end
  if (self.prefix() == nil)
    return -1
  elsif (a2.prefix() == nil)
    return 1
  end
  ret = self.namespace()<=>a2.namespace()
  if (ret == 0)
    ret = self.prefix()<=>a2.prefix()
  end
  return ret
end