Class

NameError

Inheritance
< StandardError < Exception < Object

Descendents of class Exception are used to communicate between raise methods and rescue statements in begin/end blocks. Exception objects carry information about the exception—its type (the exception‘s class name), an optional descriptive string, and optional traceback information. Programs may subclass Exception to add additional information.

Classes & Modules

Methods

Class

Visibility Signature
public new (...)

Instance

Visibility Signature
public name ()
public to_s ()

Class Method Detail

NameError.new(msg [, name]) => name_error

Construct a new NameError exception. If given the name parameter may subsequently be examined using the NameError.name method.

Instance Method Detail

name_error.name => string or nil

Return the name associated with this NameError exception.

name_error.to_s => string

Produce a nicely-formated string representing the NameError.