If you want to get what is the difference between two hashes, you can do this:
result = {} hash1.each {|key, value| result[key] = hash2[key] if hash2[key] != value } puts result
or use a this hash1.to_a == hash2.to_a turning it to an array and compairing those. or you could use to_s compare strings.
No comments:
Post a Comment