When I want to access a constant CONSTin a class Testin
class Test
CONST = 7
end
from outside the class, I have to do this:
puts Test::CONST
Why am I getting an error when I do this?
puts obj::CONST
If it objis an object of a class Test, why do I get an error if I try to access a constant through an object?
source
share