Created
November 23, 2016 04:12
-
-
Save solebox/5925c1ed01e4c4d26ab31c17d82e19ed 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
class A | |
def fooz | |
puts "bar" | |
end | |
end | |
class A | |
alias_method :super_send, :send | |
def send(symbol,*args) | |
puts "baz" | |
#prepare_foo() if [:foo].include? symbol | |
super_send(symbol,*args) | |
end | |
end | |
a = A.new | |
a.fooz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment