class Salus::Fifo

Public Class Methods

new(maxlen) click to toggle source
# File lib/salus/metric.rb, line 6
def initialize(maxlen)
  @maxlen = maxlen
  @data   = []
end

Public Instance Methods

<<(value) click to toggle source
# File lib/salus/metric.rb, line 11
def <<(value)
  @data << value
  @data.shift if @data.length > @maxlen
  self
end