Sha256: 1a9f0f82483efa279e059cf6f357e864662fd7abfaa43dfe08f4887e2a196bd0
Contents?: true
Size: 538 Bytes
Versions: 12
Compression:
Stored size: 538 Bytes
Contents
# frozen_string_literal: true module Refinements module Shared module Values # Provides shared whole value functionality for knowing the difference between two objects. module Diff def diff other if other.is_a? self.class to_h.merge(other.to_h) { |_, one, two| [one, two].uniq } .select { |_, diff| diff.size == 2 } else to_h.each.with_object({}) { |(key, value), diff| diff[key] = [value, nil] } end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems