From: ThoML Date: 2008-07-03T20:31:56+09:00 Subject: Re: nested methods good or bad design > the first method checked a server for something. > All of the other methods check an instance variable I don't know when you check the server. Maybe something like this would be a viable solution (#create could check the server): class A def self.create(x) case x when 0 A1.new(x) else A2.new(x) end end def initialize(x) @x = x end end class A1 < A def f nil end end class A2 < A def f 20 + @x end end p A.create(0).f => nil p A.create(1).f => 21