Hi --

On Tue, 4 Apr 2006, Marco wrote:

> Hi All!
>
> I'm trying to teach my Parent class how to set variables into its Child
> class; ie

The parent and its children share class variables:

irb(main):001:0> class A; @@var = 2; end
=> 2
irb(main):002:0> class B < A; @@var; end
=> 2

However, that's supposed to change in Ruby 2.0, so that class
variables will more strictly class-scoped (and not hierarchy-scoped).


David

-- 
David A. Black (dblack / wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! http://www.manning.com/books/black