class God::Timeline

Public Class Methods

new(max_size) click to toggle source

Instantiate a new Timeline

+max_size+ is the maximum size to which the timeline should grow

Returns Timeline

Calls superclass method
# File lib/god/timeline.rb, line 8
def initialize(max_size)
  super()
  @max_size = max_size
end

Public Instance Methods

<<(val)
Alias for: push
push(val) click to toggle source

Push a value onto the Timeline

+val+ is the value to push

Returns Timeline

# File lib/god/timeline.rb, line 17
def push(val)
  self.concat([val])
  shift if size > @max_size
end
Also aliased as: <<