C
Christopher J. Bottaro
Hello. I want to do this.
instance = MyClass.new
x = 1
def instance.foo
puts x
end
undefined local variable or method `x' for #<MyClass:0x31ca8c4>
How do get rid of that error?
Thanks for the help.
instance = MyClass.new
x = 1
def instance.foo
puts x
end
undefined local variable or method `x' for #<MyClass:0x31ca8c4>
How do get rid of that error?
Thanks for the help.