Skip to content

Instantly share code, notes, and snippets.

@ryanlecompte
Created May 3, 2012 00:13
Show Gist options
  • Save ryanlecompte/2582104 to your computer and use it in GitHub Desktop.
Save ryanlecompte/2582104 to your computer and use it in GitHub Desktop.
[1] pry(main)> class A
[1] pry(main)* def foo
[1] pry(main)* end
[1] pry(main)* alias_method :foo2, :foo
[1] pry(main)* end
=> A
[2] pry(main)> m1 = A.instance_method(:foo)
=> #<UnboundMethod: A#foo>
[3] pry(main)> m2 = A.instance_method(:foo2)
=> #<UnboundMethod: A#foo>
[4] pry(main)> m1 == m2
=> true
[5] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment