Created
January 3, 2016 09:42
-
-
Save osyo-manga/2cc3eed595c2fe9ef8a8 to your computer and use it in GitHub Desktop.
fuck
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
module ExImpl | |
def homu | |
p "homu" | |
end | |
end | |
module Ex | |
refine Module do | |
include ExImpl | |
# alias_method を使って再定義 | |
ExImpl.instance_methods(false).each do |name| | |
alias_method :homu, :homu | |
end | |
def mami | |
homu | |
end | |
end | |
end | |
class X | |
using Ex | |
homu | |
mami | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment