Say we are in the Interactive Ruby Browser and run:
>> sometext = "Hello, Cruel World!"
>> puts sometext
Hello, Cruel World!
To illustrate in irb:
2.3.0 :002 > Kernel.private_instance_methods.include?(:puts) => true 2.3.0 :003 > self => main 2.3.0 :004 > self.class => Object 2.3.0 :005 > self.class.ancestors => [Object, Kernel, BasicObject]
As Kenrick Chien said in his comment below, "Kernel is a module mixed in to Object, and it provides a private method called puts. In Ruby, private methods can not be called with an explicit receiver. So when you are asking about what object is doing the putting, it's the current object in scope (self) when you call puts."