From: progcat@... Date: 2008-06-10T12:34:56+09:00 Subject: accessing class variables from the outside (beginner question) I am still learning Ruby and I am trying to get something like this to work and am unsure how. I know I could do attr_reader to access "ones" but ones might be an array, hash, etc. Is there a way to do something like this: class Test def initialize @try["hashworld"] = 10000 @ones = 1,2,3,4 end def addit(one,two) #can code add one + two, from #inside and outside? return(one + two) end end tens = 10,20,30,40,50 a = Test.new p a.addit(ones[1],tens[0]) #prints 12 p a.addit(tens[3],ones[0]) #prints 41 p a.addit(tens[3],try["hashworld"]) #prints 10040 Thanks, Tom