From: dblack@... Date: 2007-07-26T05:09:43+09:00 Subject: Re: Question - Passing parameters by reference Hi -- On Thu, 26 Jul 2007, Philip Hallstrom wrote: >> On Thu, 26 Jul 2007, Chris Thiel wrote: >> >>> What if the method is returning something else already and you don't want >>> to have to return the changed value? How do you pass in a variable to a >>> method and have the change stick when it exists the method in ruby? >> >> You can change an object: >> >> def change_me(str) >> str.upcase! >> end >> >> s = "abc" > > did you mean to say... > > s = str = "abc" > > ? > >> change_me(str) No; I meant to say change_me(s) :-) David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)