Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/craig/tasks/update_cities.rb

Overview

Get diff of two Hashes

Instance Method Summary collapse

Instance Method Details

#diff(other) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/craig/tasks/update_cities.rb', line 17

def diff(other)
  self.keys.inject({}) do |memo, key|
    unless self[key] == other[key]
      memo[key] = [self[key], other[key]]
    end
    memo
  end
end