From: Peter Szinek Date: 2011-04-26T23:55:47+09:00 Subject: Setting a 'reference' inside the method body Hey guys, Can Ruby do this in some way: def foo(bar) #DO SOMETHING with bar here resulting in baz being set to {} end baz = {:fluff => :ork} foo(baz) #baz should be {} now I'd like to use it in a code which calls a callback, (the foo method in this case) but the callback is called from multiple places, and only inside foo() we know whether we want to empty the array or not... it would be complicated to return something from foo() with the current architecture (based on which we could empty the hash or not). My Ruby version is JRuby 1.6 if that makes any difference. Cheers, Peter -- Posted via http://www.ruby-forum.com/.