Почему «сам» метод модуля не может стать одноэлементным методом класса?

<code>module Test
  def self.model_method
    puts "this is a module method"
  end
end

class A
  include Test
end

A.model_method
</code>

это будет ошибка с:

undefined method `model_method' for A:Class (NoMethodError)

Но когда я использую метакласс А., он работает:

<code>module Test
  def model_method
    puts "this is a module method"
  end
end

class A
  class << self
    include Test
  end
end

A.model_method
</code>

Может кто-нибудь объяснить это?

Ответы на вопрос(0)

Ваш ответ на вопрос