ruby-changes:49990
From: hsbt <ko1@a...>
Date: Tue, 30 Jan 2018 16:08:58 +0900 (JST)
Subject: [ruby-changes:49990] hsbt:r62108 (trunk): [DOC] Refinements on modules are allowed
hsbt 2018-01-30 16:08:53 +0900 (Tue, 30 Jan 2018) New Revision: 62108 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62108 Log: [DOC] Refinements on modules are allowed From: Leo Correa <lcorr005@g...> Modified files: trunk/doc/syntax/refinements.rdoc Index: doc/syntax/refinements.rdoc =================================================================== --- doc/syntax/refinements.rdoc (revision 62107) +++ doc/syntax/refinements.rdoc (revision 62108) @@ -26,8 +26,7 @@ Here is a basic refinement: https://github.com/ruby/ruby/blob/trunk/doc/syntax/refinements.rdoc#L26 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/