[#11156] How to delete methods from superclass? — Clemens Hintze <c.hintze@...>

Hello,

25 messages 1998/12/01
[#11157] Re: How to delete methods from superclass? — matz@... (Yukihiro Matsumoto) 1998/12/01

Hi, Clemens.

[#11176] English List [Re: How to delete methods from superclass?] — gotoken@... (GOTO Kentaro) 1998/12/01

In message "[ruby-list:11157] Re: How to delete methods from superclass?"

[#11250] Ruby 用語集 — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

25 messages 1998/12/08

[#11269] 京都 (Re: [ruby-dev:3789] Re: List()) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

21 messages 1998/12/11
[#11299] Re: 京都 — MAEDA Shugo <shugo@...> 1998/12/12

前田です。

[#11393] mod_ruby — shugo@... (Shugo Maeda)

前田です。

28 messages 1998/12/21
[#11394] Re: mod_ruby — matz@... (Yukihiro Matsumoto) 1998/12/21

まつもと ゆきひろです

[#11398] Re: mod_ruby — shugo@... (Shugo Maeda) 1998/12/21

前田です。

[#11399] RE: mod_ruby — OZAWA Sakuro <crouton@...> 1998/12/21

さくです。

[#11408] Re: Be port — shugo@... (Shugo Maeda) 1998/12/22

前田です。

[#11464] ruby and IDE — Noritsugu Nakamura <nnakamur@...>

18 messages 1998/12/27
[#11465] goto (Re: ruby and IDE) — ttate@... 1998/12/27

立石です。

[ruby-list:11157] Re: How to delete methods from superclass?

From: matz@... (Yukihiro Matsumoto)
Date: 1998-12-01 07:44:28 UTC
List: ruby-list #11157
Hi, Clemens.

Is it OK for you to subscribe Japanese speaking mailing list whose
messages are mostly cryptic for you? :-)

As a maintainer of the list, I can remove you from the list, if you
desire.  But if you want to learn Japanese through this list, that is
fine.

# Maybe English speaking list should be opened...

In message "[ruby-list:11156] How to delete methods from superclass?"
    on 98/12/01, Clemens Hintze <c.hintze@gmx.net> writes:

|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 :-)

It's me answering anyway :-)

|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.

You don't have to remove methods.  You just need to delegate them.
So called `the delegator pattern' can be used for that, I guess.
`lib/delegate.rb' is the library for that purpose.  `lib/tempfile.rb'
is the example of using that library.

BTW, removing methods from superclass is also possible in Ruby, using
`undef' statement.

|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 :-(

Use Module#instance_methods to list all the public method names which
the IO object responds.  The delegation scheme in delegate.rb can be
used for that purpose too.

|PS: Sorry about my lousy English.

Mine is lousier, but much better than my German. :-<

Danke.
                                                matz.

In This Thread