Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
'move into' a module's namespace in irb
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="David A. Black, post: 4642283"] Hi -- You can use the irb command inside irb: irb(main):001:0> module M; X=1; end => 1 irb(main):002:0> irb M irb#1(M):001:0> X => 1 This puts you in a context where the object you've irb'd is self. (Use 'exit' to get back to your top-level irb session.) You could also include the module, or reopen it. There are some differences among these techniques, but somewhere in there you can probably find something. David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: [URL]http://www.rubypal.com[/URL] Now available: The Well-Grounded Rubyist ([URL]http://manning.com/black2[/URL]) "Ruby 1.9: What You Need To Know" Envycasts with David A. Black [URL]http://www.envycasts.com[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
'move into' a module's namespace in irb
Top