Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/my_hash_diff_2.rb

Instance Method Summary collapse

Instance Method Details

#my_diff(hash2) ⇒ Object



2
3
4
5
# File 'lib/my_hash_diff_2.rb', line 2

def my_diff(hash2)
    difference = self.to_a - hash2.to_a
    Hash[*difference.flatten]
end