From: Glenn Date: 2010-02-18T13:02:26+09:00 Subject: Re: simple addition program, need help --0-433542498-1266465332=:99454 Content-Type: text/plain; charset=us-ascii Spencer, @@number and @@number2 are class variables. number and number2 are local variables. Also, Ruby is case sensitive, so the doThis method and the dothis method are actually 2 different methods. ________________________________ From: Spencer Spence To: ruby-talk ML Sent: Wed, February 17, 2010 9:56:14 PM Subject: simple addition program, need help class Calculater def dothis(x,y) puts x+y end end object = Calculater.new @@number = gets @@number2 = gets object.doThis(number,number2) i'm getting this error, C:\Users\Spencer_2\Documents\NetBeansProjects\RubyApplication1\lib\new_main.rb:12: undefined local variable or method `number' for main:Object (NameError) I'm used to programming in java so I assumed that the doThis(x,y) parameters are just temporary variables in ruby. Am I wrong? -- Posted via http://www.ruby-forum.com/. --0-433542498-1266465332=:99454--