Ruby - Class self pointer

Introduction

When you run a program, Ruby creates a main object, and add any code that appears inside your main code unit.

You can verify this by creating a new source file and adding the following code:

puts self 
puts self.class 

When you run this program, you'll see the following output:

main 
Object