Incluir / estender o kernel não adiciona esses métodos principalmente: Object

Estou tentando adicionar um método aoKernel, mas em vez de reabrir oKernel e definindo diretamente um método de instância, estou escrevendo um módulo e queroKernel paraextend/include esse módulo.

module Talk
  def hello
    puts "hello there"
  end
end

module Kernel
  extend Talk
end

Quando executo isso no IRB:

$ hello
NameError: undefined local variable or method `hello' for main:Object
from (irb):12
from /Users/JackC/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>

Se eu verificar oinstance_methods emKernel, Vejo que #hello foi adicionado aoKernel, mas não emmain Object.

Eu também tentei usarinclude, mas acontece o mesmo:

module Kernel
  include Talk
end

No entanto, se eu defini-lo diretamente:

module Kernel
  def hello
    puts "hello there"
  end
end

Então, ele é incluído nomain Object.

$ hello
hello there
 => nil 

Incluindo oTalk módulo emObject também funciona:

class Object
  include Talk
end

Talvez eu esteja fazendo algo errado ou algo que esteja faltando seja simples, mas esse comportamento está me confundind

questionAnswers(6)

yourAnswerToTheQuestion