How to run IRB.start in context of current class
As you’ve already discovered, self does not refer to the object where IRB was started, but to the TOPLEVEL_BINDING, which seems to be an instance of the Object class itself. You can still run an IRB session with a specific class or object as the context, but it’s not as simple as just starting IRB. … Read more