> > The example I have above should probably be combining an IO > and > > a String since an IO accesses characters like a String: > > > > class IOString < IO > > def kind_of?(c); String==c || super; end > > # use IO methods (seek/tell/read/write) to accomplish > > # the String methods > > end > > > > This was just a toy example. > > There is a StringIO, you know. > > require 'stringio' I was aware of that. This is making a string object look like an IO. The above example was intended to make an IO class that also looks like a String. Ideally, you would be able to do something like match a regular expression against one of these things (without having to read the whole file into memory), but the regex code works on string data directly rather than use method calls. Actually, StringIO may be another example of what I'm talking about. It doesn't need to inherit anything from the IO class other than kind_of? and ancestors. __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail