From: "Wolfgang Nádasi-Donner" Date: 2007-01-20T19:40:08+09:00 Subject: Re: Minor Change Proposal for Classes 'Object' and 'Method' Vincent Fourmond schrieb: > gwtmp01@mac.com wrote: >> Method#receiver >> Method#name >> Method#origin # module/class with definition of method >> >> Kernel#origin(name) # module/class where named method is found >> # via standard method lookup process on the >> # receiver. >> # nil if no matching method found > > I vote for the last one too ! > > Vince I don't think it works well with "Kernel#origin(name)" because the lookup result may change when changing the class definitions. The method, which returns the class name, should be directly related to the existing "Method" object. Example: >>>>> Example >>>>> class Otto def hi puts "'Hi!' from an Otto instance" end end class Hugo < Otto end o1 = Hugo.new mymeth1 = o1.method(:hi) class Hugo < Otto def hi puts "'Hi!' from a Hugo instance" end end mymeth2 = o1.method(:hi) mymeth1[] # => 'Hi!' from an Otto instance mymeth2[] # => 'Hi!' from a Hugo instance p mymeth1 # => # p mymeth2 # => # >>>>> End of Example >>>>> Wolfgang N�dasi-Donner