mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC] Refinements on modules are allowed
From: Leo Correa <lcorr005@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3f7221ad3d
commit
b0d1586fa7
1 changed files with 1 additions and 2 deletions
|
@ -26,8 +26,7 @@ Here is a basic refinement:
|
|||
end
|
||||
|
||||
First, a class +C+ is defined. Next a refinement for +C+ is created using
|
||||
Module#refine. Refinements only modify classes, not modules so the argument
|
||||
must be a class.
|
||||
Module#refine. Refinements can modify both classes and modules.
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue