I have a following lines in my ruby script. It gives the output as
puts self #=> main
puts self #=> Ex
Main is the special object, with special properties.
You touched theme called
Introspection. What information wikipedia gives about it:
In computing, type introspection is the ability of a program to examine the type or properties of an object at runtime.
So what you are doing is calling
So lets move further, what we can do with this?
This will give
Object. So next important thing is:
Everything in Ruby occurs in the context of some object.
So there is nice answer which disclose this.