ara.t.howard / noaa.gov wrote:
> 
>   OPEN = File.method 'open'
> 
>   class File
>     def self.open(*a) 42 end
>     end
>   end

It seems there's an "end" too much.  But to the real story: here's a 
completely different idea - although not very nice either:

irb(main):004:0> F2=SimpleDelegator.new File
=> File
irb(main):005:0> def F2.open(*a) 42 end
=> nil
irb(main):006:0> F_OLD=File
=> File
irb(main):007:0> File=F2
(irb):7: warning: already initialized constant File
=> File
irb(main):008:0> File.open
=> 42
irb(main):009:0> File=F_OLD
(irb):9: warning: already initialized constant File
=> File


Drawback is the const reassignment...

Kind regards

	robert