Class: LibXML::XML::Error

### Home Classes Methods

### In Files

- lib/libxml/error.rb

### Parent

Object

### Methods

- #==
- #code_to_s
- #domain_to_s
- #eql?
- #level_to_s
- #to_s

### Class/Module Index

Quicksearch

- LibXML
- LibXML::XML
- LibXML::XML::Attr
- LibXML::XML::AttrDecl
- LibXML::XML::Attributes
- LibXML::XML::Document
- LibXML::XML::Error
- LibXML::XML::HTMLParser
- LibXML::XML::Namespace
- LibXML::XML::Namespaces
- LibXML::XML::Node
- LibXML::XML::Parser
- LibXML::XML::Reader
- LibXML::XML::SaxParser
- LibXML::XML::SaxParser::Callbacks
- LibXML::XML::SaxParser::VerboseCallbacks
- LibXML::XML::Schema
- LibXML::XML::Schema::Attribute
- LibXML::XML::Schema::Element
- LibXML::XML::Schema::Namespaces
- LibXML::XML::Schema::Type
- LibXML::XML::Schema::Types
- LibXML::XML::XPath
- LibXML::XML::XPath::Object
- Object

No matching classes.

# LibXML::XML::Error

### Constants

DOMAIN_CODE_MAP

  Create mapping from domain constant value to keys

ERROR_CODE_MAP

  Create mapping from domain constant value to keys

QUIET_HANDLER

  Quiet error handler

VERBOSE_HANDLER

  Verbose error handler

### Public Instance Methods

==(other) click to toggle source

    # File lib/libxml/error.rb, line 36
    def ==(other)
      eql?(other)
    end

code_to_s() click to toggle source

    # File lib/libxml/error.rb, line 75
    def code_to_s
      ERROR_CODE_MAP[self.code]
    end

domain_to_s() click to toggle source

    # File lib/libxml/error.rb, line 71
    def domain_to_s
      DOMAIN_CODE_MAP[self.domain]
    end

eql?(other) click to toggle source

    # File lib/libxml/error.rb, line 40
    def eql?(other)
      self.code == other.code and
      self.domain == other.domain and
      self.message == other.message and
      self.level == other.level and
      self.file == other.file and
      self.line == other.line and
      self.str1 == other.str1 and
      self.str2 == other.str2 and
      self.str3 == other.str3 and
      self.int1 == other.int1 and
      self.int2 == other.int2 and
      self.ctxt == other.ctxt and
      self.node == other.node
    rescue
      false
    end

level_to_s() click to toggle source

    # File lib/libxml/error.rb, line 58
    def level_to_s
      case self.level
        when NONE
          ''
        when WARNING
          'Warning:'
        when ERROR
          'Error:'
        when FATAL
          'Fatal error:'
      end
    end

to_s() click to toggle source

    # File lib/libxml/error.rb, line 79
    def to_s
      msg = super
      msg = msg ? msg.strip: ''

      if self.line
        sprintf("%s %s at %s:%d.", self.level_to_s, msg,
                                   self.file, self.line)
      else
        sprintf("%s %s.", self.level_to_s, msg)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.