given this code:
class A CONST = \'A\' def initialize puts CONST end end class B < A CONST = \'B\' end A.new # => \'A\' B.new # => \'A\'
I had a few issues with the solution by Konstantin Haase. When accessing the constant in an instantiated object of the inheriting class, the parent constant was used.
I had to explicitly refer to the class.
self.class::CONST
cheers