1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

autoloading guide: relax type of constant names [ci skip]

This commit is contained in:
Xavier Noria 2014-12-15 09:40:41 +01:00
parent 0f54387d3c
commit fdbeda449e

View file

@ -238,21 +238,21 @@ end
First, when the `module` keyword is processed the interpreter creates a new
entry in the constant table of the class object stored in the `Object` constant.
Said entry associates the string "Colors" to a newly created module object.
Said entry associates the name "Colors" to a newly created module object.
Furthermore, the interpreter sets the name of the new module object to be the
string "Colors".
Later, when the body of the module definition is interpreted, a new entry is
created in the constant table of the module object stored in the `Colors`
constant. That entry maps the string "RED" to the string "0xff0000".
constant. That entry maps the name "RED" to the string "0xff0000".
In particular, `Colors::RED` is totally unrelated to any other `RED` constant
that may live in any other class or module object. If there were any, they
would have separate entries in their respective constant tables.
Put special attention in the previous paragraphs to the distinction between
class and module objects, constant names as strings, and value objects
assiociated to them in constant tables.
class and module objects, constant names, and value objects assiociated to them
in constant tables.
autoload_paths