From: Robert Dober Date: 2006-11-01T17:33:37+09:00 Subject: Re: Difference between define_method and def method; end ------=_Part_24775_30591635.1162370015160 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/31/06, ara.t.howard@noaa.gov wrote: > > On Tue, 31 Oct 2006, Rune Hammersland wrote: > > > Hello dear Rubyists. > > > > It was suggested on the IRC channel that I try the ML for this problem > ... > > > > While looking at how to undefine a method, I found out that there is a > > difference in how define_method and the def ... end block works. Example > > coming up: > > > > > # Try to redefine method and call super. > > class Child < Parent > > you are not redefining the method here, you are redefining the class. > [...] > Ara I am afraid that is not so :(, run this e.g. class Parent end class Child < Parent puts self.object_id def one; puts "one" end end class Child < Parent puts self.object_id end Child.new.one > harp:~ > ruby a.rb > LOL: superclass method `lol' disabled It does the same as OP's code, I really feel this is strange. Rune, on philiosophical grounds, I prefer the second behavior the super method being available again, can you elaborate on why you prefer the first? Cheers Robert -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ------=_Part_24775_30591635.1162370015160--