From: Pit Capitain Date: 2006-07-14T07:13:27+09:00 Subject: Re: challenge ara.t.howard@noaa.gov schrieb: > On Fri, 14 Jul 2006 Ara.T.Howard@noaa.gov wrote: >> >> OPEN = File.method 'open' >> >> class File >> def self.open(*a) 42 end >> end >> end >> >> ## now restore File.open using OPEN - remember that open takes a block... > > correction. start here > > open_m = File.method 'open' > > class File > def self.open(*a) 42 end > end > end > > using a const makes it too easy and will accomplish what i need to do. class << File; self; end.class_eval do remove_method :open end Regards, Pit