In ruby the lack of a ! at the end of a method isn't a guarantee that a function changes (caught me a few times by surprise). It is just used to distinguish between a state-changing version and nonstate-changing version. The reason for that was to limit the number of !! in your code.
Ugh, as lojic pointed out (thanks for that :)), some sleep-deprived errors in this post. The more correct version:
In ruby, the lack of a ! at the end of a method isn't a guarantee that a function doesn't modiefy state.
And you're right about (+ counter 1). Blindly remembered the example I got in the ruby forum when I was surprised that some method modified state without a warning !.