Type:
Class

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:

Fixnum.const_set :answer, 42

raises the exception:

NameError: wrong constant name answer
name

name_error.name â string or nil Instance Public methods Return the name

2015-04-20 11:36:43
new

NameError.new(msg [, name]) â name_error Class Public methods Construct a

2015-04-20 11:29:15
to_s

name_error.to_s â string Instance Public methods Produce a nicely-formatted

2015-04-20 11:39:47