On Tuesday 11 June 2002 07:06 am, Serg Koren wrote:
> Hi,
>   I'm just trying to learn Ruby and am wondering what the proper
> way of having a composite class (not a mixin).  I'd like to have
> one class be an instance variable of another class.

Do you mean that you want *an instance* of one class be an instance 
variable of another class? This is done all the time.

class X
	def myX
	end
end

class Y
	def initialize
		@myX = X.new
	end
	attr_reader :myX
end

> Class Y
>   myNest = X::new

This would be a local variable, not an instance variable.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE