F
Farhad Farzaneh
Is there a way to determine what equivalent methods are, that is, what
has been aliased to what on an object or class?
has been aliased to what on an object or class?
Hmm I do not know how to identify which name was used originally andIs there a way to determine what equivalent methods are, that is, what
has been aliased to what on an object or class?
Robert said:24/122 > irb
irb(main):001:0> class A
irb(main):002:1> def x; end
irb(main):003:1> def y; end
irb(main):004:1> alias_method :z, :x
irb(main):005:1> end
=> A
irb(main):006:0> A.instance_methodx) == A.instance_method
y)
=> false
irb(main):007:0> A.instance_methodx) == A.instance_method
z)
=> true
irb(main):008:0>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.