From: Pit Capitain Date: 2007-05-03T05:10:25+09:00 Subject: Re: simple subclass question Ball, Donald A Jr (Library) schrieb: > In point of fact, I can work around the @foods.nil? case in the > self.foods method, but I'd rather figure out either how to do this or > why it's a bad idea to do it. :) Donald, I would add def self.my_foods @foods ||= [] end and then use my_foods instead of @foods in the other two methods. You could also take a look at Ara's attributes library: http://codeforpeople.com/lib/ruby/attributes/attributes-3.2.0/README Regards, Pit