Sha256: 325031764d5cb32b8f697607c44154f7607586045fd4697cb46fcd6f4c761d62

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

require "hash_diff/version"
require "hash_diff/comparison"

module HashDiff
  class << self
    def diff(*args)
      Comparison.new(*args).diff
    end

    def left_diff(*args)
      Comparison.new(*args).left_diff
    end

    def right_diff(*args)
      Comparison.new(*args).right_diff
    end

    def patch!
      Hash.class_eval do
        def diff right
          HashDiff.left_diff self, right
        end
      end unless self.class.respond_to? :diff
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hash_diff-0.7.0 lib/hash_diff.rb