Sha256: 8dcb387485315d8b99b3ba325b46ccd101a01f00ac027961edd50225daae6dda
Contents?: true
Size: 321 Bytes
Versions: 4
Compression:
Stored size: 321 Bytes
Contents
module Bluepill module Util class RotationalArray < Array def initialize(size) @capacity = size super() # no size - intentionally end def push(value) super(value) shift if length > @capacity self end alias_method :<<, :push end end end
Version data entries
4 entries across 4 versions & 1 rubygems