Here is my code:
这是我的代码:
records_hash = records[:id].inject({}) { |result,h|
if result.has_key?(h)
result[h] += 1
else
result[h] = 1
end
result
}
@test2 = records_hash.each{|key,value| puts "#{key} is #{value}"}
records_hash = recHere is my code:
这是我的代码:
records_hash = records[:id].inject({}) { |result,h|
if result.has_key?(h)
result[h] += 1
else
result[h] = 1
end
result
}
@test2 = records_hash.each{|key,value| puts "#{key} is #{value}"}
records_hash = rec