From: "David A. Black" Date: 2009-06-21T00:11:21+09:00 Subject: Re: 'move into' a module's namespace in irb Hi -- On Sat, 20 Jun 2009, Max Williams wrote: > Hi David > > Yeah, i use irb inside irb a lot, it's really useful when i'm puzzling > over an instance method for example (usually in the rails console). It > didn't occur to me to use it here (obviously). > > Using 'include' seems better in this case as i still have the more > general scope - i'm using irb in this case like i would normally use the > rails console, but using Thoth (a framework for blogs) rather than > Rails. So, including the module rather than moving into it seems more > like my general app environment, which i guess is what you want in a > console like this. Would you agree? It sounds OK, as long as there's nothing in Thoth that's going to be masked by what's already in Object. For example, if there's a Thoth::String, you won't see it: irb(main):001:0> module M; String=1; end => 1 irb(main):002:0> include M => Object irb(main):003:0> String => String as opposed to: irb(main):004:0> irb M irb#1(M):001:0> String => 1 David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Now available: The Well-Grounded Rubyist (http://manning.com/black2) "Ruby 1.9: What You Need To Know" Envycasts with David A. Black http://www.envycasts.com