Exception: RTF::RTFError

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

Overview

This is the exception class used by the RTF library code to indicate errors.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ RTFError

This is the constructor for the RTFError class.

Parameters

message

A reference to a string containing the error message for the exception defaults to nil.



24
25
26
# File 'lib/rtf.rb', line 24

def initialize(message=nil)
   super(message == nil ? 'No error message available.' : message)
end

Class Method Details

.fire(message = nil) ⇒ Object

This method provides a short cut for raising RTFErrors.

Parameters

message

A string containing the exception message. Defaults to nil.

Raises:



32
33
34
# File 'lib/rtf.rb', line 32

def RTFError.fire(message=nil)
   raise RTFError.new(message)
end