> as we can use
> foo ||= Cart.new
> so that if foo is nil, then now foo = Cart.new
>
> but let's say if I have a variable i want to increment by 1
> is there an idiomatic and elegant way to say
>
> foo += 1, unless foo is nil, then set it to 1 ?

foo = foo.to_i + 1

would work as nil.to_i == 0