Sha256: 886820a72f9d58b7a17b8e336a6daa8dec568b36760b3c8c230839c66e14bc94
Contents?: true
Size: 486 Bytes
Versions: 67
Compression:
Stored size: 486 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
67 entries across 67 versions & 21 rubygems