Class: Hash
- Includes:
- HashRecursiveBlank, HashRecursiveMerge
- Defined in:
- lib/lib/utils.rb
Instance Method Summary collapse
Methods included from HashRecursiveBlank
Methods included from HashRecursiveMerge
Instance Method Details
#diff(other) ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/lib/utils.rb', line 163 def diff(other) (self.keys + other.keys).uniq.inject({}) do |memo, key| unless self[key] == other[key] if self[key].kind_of?(Hash) && other[key].kind_of?(Hash) memo[key] = self[key].diff(other[key]) else memo[key] = [self[key], other[key]] end end memo end end |