Class variables

S

StephenSykes

I know the rules for class variables have changed in 1.9, but I am not
understanding this behaviour (this works ok in 1.8.x):
?> B.new.show
22
NameError: uninitialized class variable @@x in B
from (irb):14:in `show'
from (irb):18
from :0
$ ruby -v
ruby 1.9.0 (2004-07-29) [i686-linux]


Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top