Sha256: 8dc273b08042f89e131ed1a446a689df509bf157bae573889af7dd6f6a712dcb

Contents?: true

Size: 290 Bytes

Versions: 20

Compression:

Stored size: 290 Bytes

Contents

module WebMock

  module Util

    class Util::HashCounter
      attr_accessor :hash
      def initialize
        self.hash = {}
      end
      def put key, num=1
        hash[key] = (hash[key] || 0) + num
      end
      def get key
        hash[key] || 0
      end
    end

  end
  
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
webmock-1.5.0 lib/webmock/util/hash_counter.rb
webmock-1.4.0 lib/webmock/util/hash_counter.rb
webmock-1.3.5 lib/webmock/util/hash_counter.rb
webmock-1.3.4 lib/webmock/util/hash_counter.rb
webmock-1.3.3 lib/webmock/util/hash_counter.rb
webmock-1.3.2 lib/webmock/util/hash_counter.rb
webmock-1.3.1 lib/webmock/util/hash_counter.rb
webmock-1.3.0 lib/webmock/util/hash_counter.rb
webmock-1.2.2 lib/webmock/util/hash_counter.rb
webmock-1.2.1 lib/webmock/util/hash_counter.rb
webmock-1.2.0 lib/webmock/util/hash_counter.rb
webmock-1.1.0 lib/webmock/util/hash_counter.rb
webmock-1.0.0 lib/webmock/util/hash_counter.rb
webmock-0.9.1 lib/webmock/util/hash_counter.rb
webmock-0.9.0 lib/webmock/util/hash_counter.rb
webmock-0.8.2 lib/webmock/util/hash_counter.rb
webmock-0.8.1 lib/webmock/util/hash_counter.rb
webmock-0.8.0 lib/webmock/util/hash_counter.rb
webmock-0.7.3 lib/webmock/util/hash_counter.rb
webmock-0.7.2 lib/webmock/util/hash_counter.rb