From: Dave Thomas Date: 2001-08-16T22:46:34+09:00 Subject: [ruby-talk:19897] Re: Why not?: Assigning to self "Pit Capitain" writes: > class Rectangle > def set_size( width, height ) > if width == height > become Square.new( width ) > else > @width, @height = width, height > end > end > end > > class Square < Rectangle > def set_size( width, height ) > if width == height > super > else > become Rectangle.new( width, height ) > end > end > end > > This implementation meets the (at least my) intuition. I still don't see this. There's no difference between your two classes except they sometimes become one another. Why not class Rectangle def set_size(width, height) @width, @height = width, height end def is_square? @width == @height end end What does all this class morphing get you? Dave