Sha256: 7854663dc1d87c15d38b9ebf6590e860826c1c2c110c85b6b4af2e3360b9b07a
Contents?: true
Size: 622 Bytes
Versions: 16
Compression:
Stored size: 622 Bytes
Contents
class Hash #increments a hash with the stats defined in h_stats # three levels: # STATS->plugin_name->Property->count def add_stats(h_stats) h=self h_stats.each do |plugin_hash,add_stats| h[plugin_hash]={} if h[plugin_hash].nil? add_stats.each do |property,hash_value| h[plugin_hash][property]={} if h[plugin_hash][property].nil? # values need to be in string format because of later loading from json file hash_value.each do |value, count| h[plugin_hash][property][value.to_s]=(h[plugin_hash][property][value.to_s]||0) + count end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems