From: "Älphä Blüë" Date: 2009-07-17T02:50:36+09:00 Subject: Interpolation question with each do block Hi all, I have a quick interpolation question.. def calculate_tsos(model, datavar) var = model.find(:all) var.each do |rows| puts "#{model} (Team = #{rows.team.name} | #{datavar} = #{rows.datavar}" end end The only thing that doesn't work is the datavar within interpolation in the puts statement. How do I make it so that my datavar value is passed to datavar in the puts statement so that it would be similar to: datavar = ydspgm rows.datavar should be equal to rows.ydspgm but it's not. I'll get an undefined method datavar. I'm not sure how I can pass the name of that variable to that interpolation piece of code. thanks. -- Posted via http://www.ruby-forum.com/.