Sha256: 801adef9b9d1851295ca2b59cee20618032d301b4a2f221c74f0eaee3c253619

Contents?: true

Size: 445 Bytes

Versions: 12

Compression:

Stored size: 445 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class DHS::Record

  module Merge
    extend ActiveSupport::Concern

    def merge(other)
      _record.new(_data.to_h.merge(other.to_h))
    end

    def merge!(other)
      _data._raw.merge!(other.to_h)
    end

    def deep_merge(other)
      _record.new(_data.to_h.deep_merge(other.to_h))
    end

    def deep_merge!(other)
      _data._raw.deep_merge!(other.to_h)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 lib/dhs/concerns/record/merge.rb
dhs-1.5.0 lib/dhs/concerns/record/merge.rb
dhs-1.4.2 lib/dhs/concerns/record/merge.rb
dhs-1.4.1 lib/dhs/concerns/record/merge.rb
dhs-1.4.0 lib/dhs/concerns/record/merge.rb
dhs-1.3.0 lib/dhs/concerns/record/merge.rb
dhs-1.2.0 lib/dhs/concerns/record/merge.rb
dhs-1.1.0 lib/dhs/concerns/record/merge.rb
dhs-1.0.3 lib/dhs/concerns/record/merge.rb
dhs-1.0.2 lib/dhs/concerns/record/merge.rb
dhs-1.0.1 lib/dhs/concerns/record/merge.rb
dhs-1.0.0 lib/dhs/concerns/record/merge.rb