Object
# File lib/webmock/util/hash_counter.rb, line 5 def initialize self.hash = {} @order = {} @max = 0 end
# File lib/webmock/util/hash_counter.rb, line 18 def each(&block) @order.to_a.sort {|a, b| a[1] <=> b[1]}.each do |a| block.call(a[0], hash[a[0]]) end end
# File lib/webmock/util/hash_counter.rb, line 14 def get key hash[key] || 0 end
# File lib/webmock/util/hash_counter.rb, line 10 def put key, num=1 hash[key] = (hash[key] || 0) + num @order[key] = @max = @max + 1 end
[Validate]
Generated with the Darkfish Rdoc Generator 2.