Ruby hash merge 传递代码块的例子
defaults = { a: 1, b: 2, c: 3 }
preferences = { c: 4 }

defaults.merge(preferences) { |key, old_value, new_value| [old_value, new_value].max }