Ruby 如何找到调用者当前方法的对象

wupei1024 · July 03, 2015 · Last by qhwa replied at July 03, 2015 · 1515 hits

def a 
#如何得到d
end 


class d 
   def e
      a
  end
end 

对忘了说了 f=d.new f.e 这时候得到 f 这个对象,不是 d 这个类。

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