tools/geo-ip-summary.rb
# Performs the final sorting of the hash, with descending order of counts
#
Performs the final sorting of the hash, with descending order of counts
Performs the final sorting of the hash with descending order of counts
def order_tree
    @tree.each do | country, country_hash|
      if country != 'count'
        country_hash.each do | region, region_hash |
          @tree[country][region] = order_hash(@tree[country][region]) if region != 'count'
        end
        @tree[country] = order_hash(@tree[country])
      end
    end
    @tree = order_hash(@tree)
  end
def order_tree @tree . each do | country , country_hash | if country != 'count' country_hash . each do | region , region_hash | @tree [ country ] [ region ] = order_hash ( @tree [ country ] [ region ] ) if region != 'count' end @tree [ country ] = order_hash ( @tree [ country ] ) end end @tree = order_hash ( @tree ) end
Performs the final sorting of the hash, with descending order of counts
Performs the final sorting of the hash with descending order of counts