module Demo
Myconstant = 'This is the constant'
private
def Myconstant
puts 'This is the method'
end
end
class Sample
include Demo
def test
puts Myconstant # => 'This is the constant'
end
end
Sample.new.test
Как работает приведенный выше фрагмент?
Не должен ли Myconstant
метод перезаписать "истинную" константу?
Есть ли способ вызвать метод вместо этого?
Спасибо.