what is the actual difference between class variables and constants?
If I write:
def TonyCantCode::something return @@internal end def TonyCantCode::something=(what) @@internal=what end
I get a warning about changing a constant, PLUS I called the method
TonyCantCode::something so that I didn’t have to use the brackets at
BUT… as far the the scope is concerned, they do seem to be very.
As far as I can see:
Constants would be referenced mainly from the OUTSIDE of the class.
For example, if TonyReallycantCode::Something was something very
meaningful to the USERS of TonyReallyCantCode.
Class variables would be used mainly from WITHIN the class. Yes, it
is possible to create accessors, but they might not be necessary.
This is what I worked out. Now the question is: is all the above