Skip to content

Instantly share code, notes, and snippets.

@mxrguspxrt
Created December 30, 2011 09:55
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 mxrguspxrt/1539073 to your computer and use it in GitHub Desktop.
Save mxrguspxrt/1539073 to your computer and use it in GitHub Desktop.
replace method object handled like a object
# example
class A
def a
puts "a"
end
def b
puts "b"
end
end
c = A.new
m1 = c.method(:a)
m2 = c.method(:b)
# now how can i switch m1 and m2 without using "def ..."?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment