From: Jeroen Lodewijks Date: 2012-09-21T17:46:32+09:00 Subject: Re: Class variables Thank you very much for all your replies. I think I did 2 things wrong: 1) I used new, rather than initialize 2) I thougt the syntax for a class variable was class Deck @deckarr = [1, 2, 3, 4, 5] def initialize # something end def print_all @deckarr.each do |card| puts card end end end but it is: class Deck def initialize @deckarr = [1, 2, 3, 4, 5] end def print_all @deckarr.each do |card| puts card end end end --Quote @@suits = ['C', 'D', 'H', 'S'] isn't what you would expect, so no one uses them. Rubyists use class instance variables instead, e.g --End quote From what I can see online @@suits = ['C', 'D', 'H', 'S'] creates the array only once no matter how many instances you have of the object. Is that not a good thing? I don't understand why nobody is using this? isn't what you would expect, so no one uses them. Rubyists use class instance variables instead, e.g. -- Posted via http://www.ruby-forum.com/.