Parent

Methods

Files

Class/Module Index [+]

Quicksearch

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

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

Public Instance Methods

<<(val) click to toggle source
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: <<

[Validate]

Generated with the Darkfish Rdoc Generator 2.