Hi, not a DragonRuby developer here, but I think it should be `self.bar += 1` and not `bar += 1` because you are assigning a value to `bar` , otherwise if not prepending `self.`, `bar` is then treated as a local variable:
I tested below, and it works:
@bar = 0
self.bar += 1
args.state.f ||= Foo.new
If I changed above into:
bar += 1
... I get the same errors as yours:
> ERROR. The following hash reached a nil thrashing limit.
However, copying the code into my local mri ruby installation, I get the more familiar error:
> NoMethodError (undefined method `+' for nil:NilClass)
Because `bar += 1 , translates to `bar = bar + 1`, and `bar` at that point is not defined yet, so `bar (undefined) + 1` throws that `nil:NilClass` error.
Having said this though, I think the `mri` error message better described what the error was, though maybe because I'm just not used to DragonRuby errors yet.