Skip to content

Instantly share code, notes, and snippets.

@solebox
Created November 23, 2016 04:12
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 solebox/5925c1ed01e4c4d26ab31c17d82e19ed to your computer and use it in GitHub Desktop.
Save solebox/5925c1ed01e4c4d26ab31c17d82e19ed to your computer and use it in GitHub Desktop.
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