Sha256: 7df814d821ebaaa05558ae90637946480b2d30df3b7a54a26a50127971ba4cfc
Contents?: true
Size: 357 Bytes
Versions: 34
Compression:
Stored size: 357 Bytes
Contents
# -*- encoding: utf-8 -*- module Bluepill module Util class RotationalArray < Array def initialize(size) @capacity = size super() # no size - intentionally end def push(value) super(value) self.shift if self.length > @capacity self end alias_method :<<, :push end end end
Version data entries
34 entries across 34 versions & 6 rubygems