Sha256: eab5e932557c9f78280d61ac311c32da2b847ad01304990e9edd11ee6b160e54

Contents?: true

Size: 480 Bytes

Versions: 3

Compression:

Stored size: 480 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

    def keys
      @counters.keys
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tailstrom-0.0.11 lib/tailstrom/counter_collection.rb
tailstrom-0.0.10 lib/tailstrom/counter_collection.rb
tailstrom-0.0.9 lib/tailstrom/counter_collection.rb