From: "Todd S." Date: 2006-01-30T15:13:17+09:00 Subject: misunderstanding the Passing of references I'm to to ruby... Currently, I'm stuck in a situation where I'm changing values I'm not intending to and I don't know how to correct it. I have... A class "Model" and a class "DataObject". The "Data Object" class has a method which takes in a "Model" and returns a new "Model". The problem is, my "generate_new_model" method is altering the input "Model" object. The below show basically what I've done to create the objects. Somehow when I define a new "Model" for output and set it's values to the source model's values, when I change the outputModel values it alters the source model. What am I doing wrong? @myModel = Model.new @myData = DataObject.new newModel = @myData.generate_new_model(@myModel) def generate_new_model(modelSource) outputModel = Model.new outputModel = modelSource outputModel.values = "new values" outputModel end -- Posted via http://www.ruby-forum.com/.