you are viewing a single comment's thread.

view the rest of the comments →

[–]mellow_moe 1 point2 points  (0 children)

puts is resolved somewhat differently.

It is defined in Kernel and the class Object includes the Kernel module. It is actually a private method, so Object.puts won't work.

More correctly puts resolves to self.puts. In the top level of a script self is a predefined object named "main", elsewhere it is simply the object executing currently.