What's the simplest way to access included class's protected constant in the ActiveSupport::Concern context?
Example classes:
module Printable
extend ActiveSupport::Concern
private
def print_constant
puts MY_CONSTANT
end
end
class Printer
include Printable
def print
print_constant
end
private
MY_CONSTANT = 'Hello'.freeze
end
This solution produces an error:
NameError: uninitialized constant Printable::MY_CONSTANT
I'm aware of an alternative that seems to work:
puts self.class::MY_CONSTANT
But, it doesn't feel right. :-)
Any better suggestions?