Skip to content

Instantly share code, notes, and snippets.

@zentetsukenz
Created February 2, 2016 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zentetsukenz/251a3583912892d80b5a to your computer and use it in GitHub Desktop.
Save zentetsukenz/251a3583912892d80b5a to your computer and use it in GitHub Desktop.
Find mismatch value between 2 hash
def find_mismatch_value_between_hash(a, b)
pivot_hash = a
another_hash = b
result_hash = {}
pivot_hash.keys.each do |k|
pivot_value = pivot_hash[k]
another_value = another_hash[k]
if another_value != pivot_value
result_hash[k] = { original: pivot_value, comparator: another_value }
end
end
result_hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment