On 11/3/09, Robert Klemme <shortcutter / googlemail.com> wrote:
> This will be difficult to do because then StringIO would somehow have
> to change its type.  Of course you could achieve that with some kind

IO subclasses can already change their type (and even class!) when
#reopen is called:

irb(main):001:0> f=File.open "endless.rb"
=> #<File:endless.rb>
irb(main):002:0> f.reopen STDIN
=> #<IO:0xb7d267cc>
irb(main):003:0> f
=> #<IO:0xb7d267cc>

Clearly StringIO is not a subclass of IO, but maybe this is why it should be?