From: James Gray Date: 2008-07-25T04:44:29+09:00 Subject: Re: what is "p"? On Jul 24, 2008, at 2:39 PM, matu wrote: > Farrel Lifson wrote: > >> That's correct. The Kernel module is mixed into Object (and hence is >> available in every object as every object is a descendant of Object). >> > > Ok. Thank you both. But... > > hi.rb: > module Hi > def ola > p 'ola' > end > end > >>> require 'hi' > => true >>> include Hi > => Object >>> Object.methods.include? 'ola' > => true >>> ola > "ola" > => nil >>> Object.methods.include? 'p' > => false > > WTF? Why does Object.methods not include p? Kernel is mixed in like > my Hi > module, right? So why does Object.methods include ola, but not p? It does. You just need to know that it's a private method: >> Object.private_methods.include? "p" => true James Edward Gray II