From: 7stud -- Date: 2009-08-11T20:57:44+09:00 Subject: Re: Destroying related objects doubt ... basic oop question Soh Dubom wrote: > ex.: let's say we have objects House and Rooms, the relationship between > them is composition, so House is responsible for creating new Rooms. If > I destroy the instance of House, all instances of Rooms will be > destroyed as well, Really? class House def initialize(room) @room = room end end class Room def show puts "I'm a room." end end r = Room.new h = House.new(r) h = nil r.show --output:-- I'm a room. -- Posted via http://www.ruby-forum.com/.