class A
class << self
CONST = 1
end
end
puts A::CONST # this doesn't work
Is there a way to access the constant from outside the class with this self class call?
It is effectively doing this:
class A
self.CONST = 1
end
I understand that I can just move the constant out of this self call to easily solve this problem. I'm more curious about the inner workings of ruby.