Exception: XML::SAX::SAXException
- Inherits:
-
Exception
- Object
- Exception
- XML::SAX::SAXException
- Defined in:
- lib/xml/sax.rb
Direct Known Subclasses
Instance Method Summary collapse
- #getException ⇒ Object
- #getMessage ⇒ Object
-
#initialize(message, e = nil) ⇒ SAXException
constructor
initialize(String) initialize(Exception) initialize(String, Exception).
- #toString ⇒ Object (also: #to_s)
Constructor Details
#initialize(message, e = nil) ⇒ SAXException
initialize(String) initialize(Exception) initialize(String, Exception)
246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/xml/sax.rb', line 246 def initialize(, e = nil) @message = nil @exception = nil if .kind_of?(String) && e.nil? @message = elsif .kind_of?(Exception) && e.nil? @exception = e elsif .kind_of?(String) && e.kind_of?(Exception) @message = @exception = e else raise TypeError.new("parameter error") end end |
Instance Method Details
#getException ⇒ Object
268 269 270 |
# File 'lib/xml/sax.rb', line 268 def getException @exception end |
#getMessage ⇒ Object
261 262 263 264 265 266 |
# File 'lib/xml/sax.rb', line 261 def getMessage if @message.nil? && !@exception.nil? return @exception.to_s end @message end |
#toString ⇒ Object Also known as: to_s
272 273 274 |
# File 'lib/xml/sax.rb', line 272 def toString getMessage end |