Ring buffer (circular buffer) implementation in ruby.