diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-02 00:14:58 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-02 00:14:58 +0000 |
commit | c0d4ba9f405847fee2c4fbc3c75d305d2a52a856 (patch) | |
tree | 6b8134fa1f71073fecae5bd96f272fc2525cec31 /doc/syntax/refinements.rdoc | |
parent | 474dc1e816cd84c9d6c16a023f66850da1d5cbdb (diff) |
* doc/syntax/refinements.rdoc: Improve description of where you may
activate refinements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc/syntax/refinements.rdoc')
-rw-r--r-- | doc/syntax/refinements.rdoc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/syntax/refinements.rdoc b/doc/syntax/refinements.rdoc index 519082e2f9..752f668923 100644 --- a/doc/syntax/refinements.rdoc +++ b/doc/syntax/refinements.rdoc @@ -48,9 +48,11 @@ Activate the refinement with #using: == Scope -You may activate refinements at top-level to the end of the file or in a -string passed to Kernel#eval, Kernel#instance_eval or Kernel#module_eval until -the end of the string. +You may only activate refinements at top-level, not inside any class, module +or method scope. You may activate refinements in a string passed to +Kernel#eval, Kernel#instance_eval or Kernel#module_eval that is evaluated at +top-level. Refinements are active until the end of the file or the end of the +eval string, respectively. Refinements are lexical in scope. When control is transferred outside the scope the refinement is deactivated. This means that if you require or load a |