# File lib/libxml/error.rb, line 58 def code_to_s const_map = Hash.new codes = self.class.constants - self.class.constants.grep(/XML_FROM/) - ["XML_ERR_NONE", "XML_ERR_WARNING", "XML_ERR_ERROR", "XML_ERR_FATAL"] codes.each do |code| human_name = code.gsub(/XML_ERR_/, '') const_map[self.class.const_get(code)] = human_name end const_map[self.code] end