If all 'functions' in Ruby are methods, so when I call methods without explicitly mentioning the object they are invoked on, who are they sent to?
The Ruby Programming Language book (Flanagan & Matsumoto) says if the object is omitted the method is invoked on self.
So if this code works
p "123"
Then this should work
self.p "123"
but it doesnt!
In this case I ran this in global scope so self is main and self.class is Object. So I can't invoke p on a simple Object instance (which makes sense).
I understand that Object includes Kernel where p is declared. How does the interpreter know how to access this declaration?