From: Lyle Johnson Date: 2004-07-16T03:20:37+09:00 Subject: Re: Stumped newbie... On Fri, 16 Jul 2004 03:12:16 +0900, flattree wrote: > Here is what I'm trying to do. Simulate nodes with objects. The nodes > are updated with the class's update method, now where I'm stuck is > accessing outside variables within the method. I think you're asking how to make the "outside" variable (here, the "a" Array) a global variable. You need to prefix its name with the "$" character, i.e. class Gate def update @state = $a[1].state end end and $a = Array.new num.times { |i| $a[i] = Gate.new etc. } But of course, you really should avoid using global variables if you can help it.