Sha256: 341b2a9f9504090a37c15a967b83267dc275be0685d59e736cca1a8e8a56eac6

Contents?: true

Size: 261 Bytes

Versions: 3

Compression:

Stored size: 261 Bytes

Contents

module God
  module Conditions
    
    class Timeline < Array
      def initialize(max_size)
        super()
        @max_size = max_size
      end
      
      def push(val)
        unshift(val)
        pop if size > @max_size
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
god-0.2.0 lib/god/conditions/timeline.rb
god-0.3.0 lib/god/conditions/timeline.rb
god-0.1.0 lib/god/conditions/timeline.rb