From: "Chr. Rippel" Date: 2002-01-28T01:54:21+09:00 Subject: Re: Subrange of String subclass => invalid object "Niklas Frykholm" wrote in, .... > Foo.new('a').next.type # => String > f = Foo.new('a') > f.next! > f.type # => Foo > > This is a less serious, but on the other hand much more frequent Yeah, but if you really want to be consistent that would mean f.dup.type # => Object (if did not bother overriding #dup) a bit anal even for my taste ... .... > > Possible ways forward: > > (a) "Require" that every object has a working #dup method. I.e., if .... all reasonable > end or (c) combine (a) and (b) module StringExtension def next; dup.next! end ... end /Christoph