提交 b850c4c5 编写于 作者: A Andrew White

Merge pull request #15278 from akshay-vishnoi/doc_changes

[ci skip] Improve doc for ModuleConstMissing.guess_for_anonymous
......@@ -180,10 +180,11 @@ def const_missing(const_name)
Dependencies.load_missing_constant(from_mod, const_name)
end
# Dependencies assumes the name of the module reflects the nesting (unless
# it can be proven that is not the case), and the path to the file that
# defines the constant. Anonymous modules cannot follow these conventions
# and we assume therefore the user wants to refer to a top-level constant.
# We assume that the name of the module reflects the nesting
# (unless it can be proven that is not the case) and the path to the file
# that defines the constant. Anonymous modules cannot follow these
# conventions and therefore we assume that the user wants to refer to a
# top-level constant.
def guess_for_anonymous(const_name)
if Object.const_defined?(const_name)
raise NameError, "#{const_name} cannot be autoloaded from an anonymous class or module"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册