Why does the following not work?
class Foo
def self.keyletters
self::KEYLETTERS
end
end
class Baz < Foo
KEYLETTERS = "US"
end
puts Foo.keyletters
I have seen questions for similar problems (eg. here: Have a parent class's method access the subclass's constants), but in my case Foo.keyletters is a class-method, not an instance method. I am getting
uninitialized constant Foo::KEYLETTERS (NameError)