Как extend класс B из модуля C в класс A и вызвать методы класса B, Ruby

file-one.rb

module C
  class B
    def foo
      puts 'foo'
    end
  end
 end

file-two.rb

class A
 extend C     

 def func
  A::B.foo
 end
end

index.rb

require_relative './c'
require_relative './a'

a = A.new
a.func

как вызвать метод foo появляеться ошибка, если делать вот так


Ответы (0 шт):