-
-
Save GorillaTester/e50b490f17a2b09826bc to your computer and use it in GitHub Desktop.
Revisions
-
nusco created this gist
Mar 4, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # ========================= # Spell: Refinement Wrapper # ========================= # Call an unrefined method from its refinement. module StringRefinement refine String do def reverse "x#{super}x" end end end using StringRefinement "abc".reverse # => "xcbax" # For more information: http://www.pragprog.com/titles/ppmetr/metaprogramming-ruby