Reputation: 724
The assignment statement looks like this:
my_var = false
And breaking on the very next line, the debugger shows 'my_var' with Type=NilClass and value=nil! How is this possible?
Upvotes: 4
Views: 570
Reputation: 434965
Have you examined my_var
directly without any debugger? The debugger could be getting confused or just displaying confusing results.
Upvotes: 3
Reputation: 156652
It's possible that the target object of your section of code has a "setter method" defined, so it looks like you're assigning to "my_var" but are actually calling the "my_var=
" method. See if your code has any definitions like this:
def my_var=(x)
# ...
end
If so, you'll need to change the name of the local "my_var" variable or the setter method. You could also verify by stepping into the line where you call "my_var = false
".
Upvotes: 2