From: Robert Klemme Date: 2012-01-18T04:48:32+09:00 Subject: Re: Passing reference to a class On Tue, Jan 17, 2012 at 8:36 PM, Tridib Bandopadhyay wrote: > How to pass reference to a class in Ruby? > > For example:- > > def func(x) >    x = x+1 > end > > a = 5 > func(a) > puts a 1. func is not a class, it's a method. 2. Ruby is not C++. 3. You cannot modify a variable because Ruby passes references by value. 4. The assignment in func is superfluous as you do not use x any more after assignment. What problem are you trying to solve? Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/