From: Wayne Blair Date: 2001-05-18T13:41:24+09:00 Subject: [ruby-talk:15354] Re: newbie question You have a typo in "initialize". Wayne "Ram Kochhar" wrote in message news:003801c0df4c$564efea0$e698520c@rameric... > I have the following ruby test case that works in the window environment but > does not > work on linux side (Mandrake 7.1 & ruby 1.6.2) > ----------------------- > class Test > def inititalize > @arr = Array.new > end > > def add(anObject) > @arr.push(anObject) > return @arr > end > def prn > print "array: ", @arr > end > end > a = Test.new > print a.add("testing\n") > ------------------------------- > I get the following error > > Test.rb:7:in `add': undefined method `push' for nil (NameError) > from Test.rb:15 > Thanks for the help. > > Ram Kochhar >