Created
November 5, 2015 09:48
-
-
Save ksss/0df7813c01e2689e6754 to your computer and use it in GitHub Desktop.
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 characters
#! /usr/bin/env ruby | |
module Hello | |
class World | |
def hi | |
"wow" | |
end | |
end | |
class Foo | |
def hi | |
World.new.hi | |
end | |
end | |
end | |
module ForceCall | |
refine Hello::World do | |
def hi | |
"hello" | |
end | |
end | |
end | |
using ForceCall | |
p Hello::Foo.new.hi #=> expect "hello" got "wow" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment