From: Clemens Hintze Date: 1998-12-01T16:21:16+09:00 Subject: [ruby-list:11156] How to delete methods from superclass? Hello, first sorry, that I use English for that list. But I'am a German and I don't speak Japanese very well (well, I don't speak it at all, except some words ;-). As I am very interested in Ruby, and there is no other mailing list than yours, I have to ask my question, which arise from time to time, here. I hope that's okay for you all. I don't want to bother matz with every simple question :-) Well coming to my problem/question... I have written some modules in Python. I want to rewrite them in Ruby, and contribute them. Also I want to translate some Python modules to Ruby, as I think they are very useful (BTW: Congratulations for the translation of the sgmllib.py and htmllib.py, very nice). Now I have a class which supports file locking via lockfiles (filename+".lock"). As some modules (e.g. mailread.rb) assume, that a real file would be derived from IO, I have to derive my LockedFile class from IO too. But in real that is not necessary! (BTW: One remark! As Ruby is typeless, I think it should not be necessary to force any instance of type IO or subclass in such cases. I think in OOP it should be taken as: If it behaves like a File, take it as File! Regardless whether it is a Array or whatever!). Every method call which LockedFile does not know, will be delegated to a composite @filep which is a real File. So now I have the necessity to remove all methods, coming from IO without removing, of course, of LockedFile's own methods. I would like to know a "automatic way" to do that. Does anybody know such a way? But nevertheless I would propose to remove such requirements for derivation from IO. It would make things much easier. And it is not really necessary for a OOPS. The next module I want to translate is the module StringIO from Python. I would not like to derive it from class IO, as it has nothing to do with I/O. It only fakes things a little bit. But with the current scheme, I have to derive it from IO :-( What do you all thing? Greetings, Cle. PS: Sorry about my lousy English.