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.



22
23
24
# File 'lib/rtf.rb', line 22

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:



30
31
32
# File 'lib/rtf.rb', line 30

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