Ruby 求教:What's the instance method search in inheritance hierarchy

lihuazhang · March 27, 2012 · Last by lihuazhang replied at March 27, 2012 · 2665 hits

在 ruby 元编程里看到, 一个 obj 的方法在查找时,会先去它的 eigenclass 里面查找, 如果找不到,就会去它的 superclass 查找, 那如果 superclass 找不到,是从 superclass 的 eigenclass 里找呢? 还是去 superclass 的 superclass 呢?

另外实例方法的查找和单件方法查找的路径是不是一样呢?

自己想明白了。。。结贴吧!

You need to Sign in before reply, if you don't have an account, please Sign up first.