Raised when a given name is invalid or undefined.

puts foo

raises the exception:

NameError: undefined local variable or method `foo' for main:Object

Since constant names must start with a capital:

Integer.const_set :answer, 42

raises the exception:

NameError: wrong constant name answer
Class Methods

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

Instance Methods

Return a list of the local variable names defined where this NameError exception was raised.

Internal use only.

Return the name associated with this NameError exception.

Return the receiver associated with this NameError exception.