Sha256: 37a05dc7a247f1e67a084f20c8101bb124f85c9a49966583b45402b8387398a6

Contents?: true

Size: 437 Bytes

Versions: 5

Compression:

Stored size: 437 Bytes

Contents

require 'tailstrom/counter'

module Tailstrom
  class CounterCollection
    def initialize
      clear
    end

    def clear
      @counters = Hash.new {|h, k| h[k] = Counter.new }
    end

    def [](key)
      @counters[key]
    end

    def empty?
      @counters.empty?
    end

    def each(&block)
      @counters.each &block
    end

    def to_a
      @counters.to_a
    end

    def size
      @counters.size
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tailstrom-0.0.8 lib/tailstrom/counter_collection.rb
tailstrom-0.0.7 lib/tailstrom/counter_collection.rb
tailstrom-0.0.6 lib/tailstrom/counter_collection.rb
tailstrom-0.0.5 lib/tailstrom/counter_collection.rb
tailstrom-0.0.4 lib/tailstrom/counter_collection.rb