Exception: XMLScan::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/xmlscan/visitor.rb

Direct Known Subclasses

NotValidError, NotWellFormedError, ParseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, path = nil, lineno = nil) ⇒ Error

Returns a new instance of Error.



17
18
19
20
21
# File 'lib/xmlscan/visitor.rb', line 17

def initialize(msg, path = nil, lineno = nil)
  super msg
  @path = path
  @lineno = lineno
end

Instance Attribute Details

#linenoObject (readonly)

Returns the value of attribute lineno.



23
24
25
# File 'lib/xmlscan/visitor.rb', line 23

def lineno
  @lineno
end

#pathObject (readonly)

Returns the value of attribute path.



23
24
25
# File 'lib/xmlscan/visitor.rb', line 23

def path
  @path
end

Instance Method Details

#to_sObject



25
26
27
28
29
30
31
# File 'lib/xmlscan/visitor.rb', line 25

def to_s
  if @lineno and @path then
    "#{@path}:#{@lineno}:#{super}"
  else
    super
  end
end