Say I did the following while in the
Ruby creates a object of Object class when you run your console, so all methods are private instance methods of Object class, you can run this to verify.
So when you define your methods in console It is interpreted to this
class Object def test puts "hi" end end
I was wanted to explain this but a detailed article is written on this topic,