Last active
October 21, 2017 20:07
-
-
Save mariozig/0c957e52654e19bba7d051d2782d7780 to your computer and use it in GitHub Desktop.
Something that should never be done... http://ruby.zigzo.com/2017/10/21/refinements-fancy-monkey/
This file contains 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 characters
module IntegerRefinements | |
refine Integer do | |
def to_s | |
'TWO, ALWAYS TWO!!!!' | |
end | |
end | |
end | |
class CrazyInteger | |
using IntegerRefinements | |
def self.crazy_string(number) | |
number.to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment