When I type self, I get a return value main. I made this test:
self
main
main2 = Object.new
Then I can call main2
main2
"What is the Ruby Top-Level?" is an article on the Ruby top level that explains everything you need to know.
As an aside however, you can access main anywhere in your program by using TOPLEVEL_BINDING.eval('self').
TOPLEVEL_BINDING.eval('self')