Skip to content

Instantly share code, notes, and snippets.

@mariozig
Last active October 21, 2017 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariozig/0c957e52654e19bba7d051d2782d7780 to your computer and use it in GitHub Desktop.
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/
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