From: Steve Wilhelm Date: 2009-11-28T14:22:54+09:00 Subject: Re: Class variables, instance variables, singleton; Ruby v. C++ Ralph Shnelvar wrote: > Newb here coming from C++ > > Ok, I _think_ I know what a class variable is. It is similar to a > static variable in a class in C++. Rght? > > An instance variable is apart of an instantiated class, right? > > What's a singleton? I don't think it's the same as as singleton in > C++ parlance. > > - - - > > If Class X wants to access a class variable and/or constant in Class Y, > must a class > method be defined or is there a direct way to do it? > > Besides the Pickaxe book, can anyone recommend a document that > describes this a bit more clearly? 'The Ruby Programming Language' by Flanagan and Matsumoto describes the differences between class variables and class instances variables. Don't know if it will be any clearer than 'Programming Ruby' by Thomas, Fowler, and Hunt. > > - - - > > So I did a search for "ruby for c++ programmers." on Google and came > up with exactly one article > (http://californickation.blogspot.com/2008/02/first-look-at-ruby.html) > ... one that says "Another funny fact is that searching for "Ruby for > Java programmers" retrieves a few articles right on the first page while > "Ruby for C++ programmers" does not." > > Anyone know of any articles? -- Posted via http://www.ruby-forum.com/.