Ruby Language Implicit Receivers and Understanding Self Keywords change the implicit receiver


Example

When you define a class or module, the implicit receiver becomes a reference to the class itself. For example:

puts "I am #{self}"
class Example
  puts "I am #{self}"
end

Executing the above code will print:

"I am main"
"I am Example"