Sha256: 306f9a6b120f3daa4dc8baed68abd90c60a00a913c2e9734b02b4f336dbd42a0
Contents?: true
Size: 475 Bytes
Versions: 12
Compression:
Stored size: 475 Bytes
Contents
module God class Timeline < Array # Instantiate a new Timeline # +max_size+ is the maximum size to which the timeline should grow # # Returns Timeline def initialize(max_size) super() @max_size = max_size end # Push a value onto the Timeline # +val+ is the value to push # # Returns Timeline def push(val) self.concat([val]) shift if size > @max_size end alias_method :<<, :push end end
Version data entries
12 entries across 12 versions & 3 rubygems