M
Mike 1.
Hi all,
I would be asking my instructor this question be she is not available
on
the weekends...
How do I make "n" available from anywhere inside the class? I need to
keep the values in n from call to call.
When calling the method "pt", "n" acts as if it was not declared above.
I get -1 instead of what I wish for ... 99.
Thanks in advance,
Mike
class Test
n=100
def pt
puts "hi there"
n=-1
end
end
t = Test.new
puts t.pt
I would be asking my instructor this question be she is not available
on
the weekends...
How do I make "n" available from anywhere inside the class? I need to
keep the values in n from call to call.
When calling the method "pt", "n" acts as if it was not declared above.
I get -1 instead of what I wish for ... 99.
Thanks in advance,
Mike
class Test
n=100
def pt
puts "hi there"
n=-1
end
end
t = Test.new
puts t.pt