From: "Marcin Mielżyński" Date: 2006-07-14T08:00:14+09:00 Subject: Re: "Self" Reference Nathan Olberding wrote: > Is it possible to define new classes that behave like standard datatypes > when an instance is referred to? For example: > > class ListOfBuddies > def initialize > self = [] > self.push(Guy.new(name)) > end > end > buddy_list = ListOfBuddies.new Then, definitely, inheritance is the right choice: class ListOfBuddies < Array def initialize self.push(Guy.new(name)) end end buddy_list = ListOfBuddies.new lopex