What does Ruby constants really mean? The following code doesn\'t show any \'constant\' attribute. The warning is there, but I still get to change what A refers to.
That's right, constants are just like variables in ruby, but you get a warning if you change them.
Also, there's one difference with mere variables: You can access constants even if they are defined inside another class or module, for example given this snippet:
module Constants
PI = 3,1415
other = "variable"
end
You can reach PI doing Constants::PI while Constants::other will not work.