Small improvement in refinements docs

Move general statement about refinements of modules
from example to the top of the document.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
stomar 2018-12-24 21:14:38 +00:00
Родитель 3c16862c85
Коммит 014a9e0587
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -7,7 +7,7 @@ changes. This can cause unintended side-effects or breakage of programs.
Refinements are designed to reduce the impact of monkey patching on other Refinements are designed to reduce the impact of monkey patching on other
users of the monkey-patched class. Refinements provide a way to extend a users of the monkey-patched class. Refinements provide a way to extend a
class locally. class locally. Refinements can modify both classes and modules.
Here is a basic refinement: Here is a basic refinement:
@ -26,7 +26,7 @@ Here is a basic refinement:
end end
First, a class +C+ is defined. Next a refinement for +C+ is created using First, a class +C+ is defined. Next a refinement for +C+ is created using
Module#refine. Refinements can modify both classes and modules. Module#refine.
Module#refine creates an anonymous module that contains the changes or Module#refine creates an anonymous module that contains the changes or
refinements to the class (+C+ in the example). +self+ in the refine block is refinements to the class (+C+ in the example). +self+ in the refine block is