Parent

LibXML::XML::Error

Constants

VERBOSE_HANDLER

Verbose error handler

QUIET_HANDLER

Quiet error handler

Public Instance Methods

==(other) click to toggle source
    # File lib/libxml/error.rb, line 16
16:       def ==(other)
17:         eql?(other)
18:       end
code_to_s() click to toggle source
    # File lib/libxml/error.rb, line 60
60:       def code_to_s
61:         const_map = Hash.new
62:         codes = self.class.constants - 
63:                 self.class.constants.grep(/XML_FROM/) -
64:                 ["XML_ERR_NONE", "XML_ERR_WARNING", "XML_ERR_ERROR", "XML_ERR_FATAL"]
65: 
66:         
67:         codes.each do |code|
68:           human_name = code.gsub(/XML_ERR_/, '')
69:           const_map[self.class.const_get(code)] = human_name
70:         end
71: 
72:         const_map[self.code]
73:       end
domain_to_s() click to toggle source
    # File lib/libxml/error.rb, line 49
49:       def domain_to_s
50:         const_map = Hash.new
51:         domains = self.class.constants.grep(/XML_FROM/)
52:         domains.each do |domain|
53:           human_name = domain.gsub(/XML_FROM_/, '')
54:           const_map[self.class.const_get(domain)] = human_name
55:         end
56: 
57:         const_map[self.domain]
58:       end
eql?(other) click to toggle source
    # File lib/libxml/error.rb, line 20
20:       def eql?(other)
21:         self.code == other.code and
22:         self.domain == other.domain and
23:         self.message == other.message and
24:         self.level == other.level and
25:         self.file == other.file and
26:         self.line == other.line and
27:         self.str1 == other.str1 and
28:         self.str2 == other.str2 and
29:         self.str3 == other.str3 and
30:         self.int1 == other.int1 and
31:         self.int2 == other.int2 and
32:         self.ctxt == other.ctxt and
33:         self.node == other.node
34:       end
level_to_s() click to toggle source
    # File lib/libxml/error.rb, line 36
36:       def level_to_s
37:         case self.level
38:           when NONE
39:             ''
40:           when WARNING
41:             'Warning:'
42:           when ERROR
43:             'Error:'
44:           when FATAL
45:             'Fatal error:'
46:         end
47:       end
to_s() click to toggle source
    # File lib/libxml/error.rb, line 75
75:       def to_s
76:         msg = super
77:         msg = msg ? msg.strip: ''
78: 
79:         if self.line
80:           sprintf("%s %s at %s:%d.", self.level_to_s, msg,
81:                                      self.file, self.line)
82:         else
83:           sprintf("%s %s.", self.level_to_s, msg)
84:         end
85:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.