lib/quickbooks/ruby_magic.rb
# Returns values in this hash that are uniq or different than in the hash provided.
# Example:
#   {:a => :b, :f => :g, :z => :e}.diff(:a => :b, :f => :r, :u => :o) # => {:f => :g, :z => :e}
Returns values in this hash that are uniq or different than in the hash provided.
Returns values in this hash that are uniq or different than in the hash provided .
def diff(hsh)
    dif = {}
    self.each do |k,v|
      dif[k] = v if !hsh.has_key?(k)
      if self[k].respond_to?(:===)
        dif[k] = v if !(self[k] === hsh[k])
      else
        dif[k] = v if !(self[k] == hsh[k])
      end
    end
    dif
  end
def diff ( hsh ) dif = { } self . each do | k , v | dif [ k ] = v if ! hsh . has_key? ( k ) if self [ k ] . respond_to? ( :=== ) dif [ k ] = v if ! ( self [ k ] === hsh [ k ] ) else dif [ k ] = v if ! ( self [ k ] == hsh [ k ] ) end end dif end
Returns values in this hash that are uniq or different than in the hash provided.
Returns values in this hash that are uniq or different than in the hash provided .
hsh
<not_specific>