Simple ruby program not working

I'm trying to simply add 200 to index, but am getting the error:
"`initialize': undefined method `+' for #<NumNode:0x82537b4 @num=2>
(NoMethodError)"
Any thoughts on how I can fix this?

class StoreNode < UnaryNode
  def initialize(subTree, index)
    super(subTree)
    @theIndex = index + 200
  end

  def evaluate()
    i = @subTree.evaluate()
    $calc.out.write("M[")
    $calc.out.write(@theIndex)
    $calc.out.write("]:= M[sp + 0]\n")
  end
end

···

--
Posted via http://www.ruby-forum.com/.

Define a "+" method on the "NumNode" class?

···

On Tue, Feb 4, 2014 at 5:13 PM, Conor Mr <lists@ruby-forum.com> wrote:

I'm trying to simply add 200 to index, but am getting the error:
"`initialize': undefined method `+' for #<NumNode:0x82537b4 @num=2>
(NoMethodError)"
Any thoughts on how I can fix this?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

twitter: @hassan

Thank you! Got it working.

···

--
Posted via http://www.ruby-forum.com/.