Sha256: a920fc9076cb561cb88aef6029b46ed99a36b18e03a7f391de0e1c9a54f139ea

Contents?: true

Size: 395 Bytes

Versions: 48

Compression:

Stored size: 395 Bytes

Contents

# ********** Copyright 2016 Viacom, Inc. Apache 2.0 **********

class ::Hash
  def deep_merger
    merger = proc { |_key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2  }
  end
  def deep_merge(second)
    self.merge(second, &deep_merger)
  end
  def deep_merge!(second)
    self.merge!(second, &deep_merger)
  end
  def deep_dup
    Marshal.load(Marshal.dump(self))
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
roku_builder-4.30.0 lib/roku_builder/hash.rb
roku_builder-4.29.9 lib/roku_builder/hash.rb
roku_builder-4.29.8 lib/roku_builder/hash.rb
roku_builder-4.29.7 lib/roku_builder/hash.rb
roku_builder-4.29.6 lib/roku_builder/hash.rb
roku_builder-4.29.4 lib/roku_builder/hash.rb
roku_builder-4.29.2 lib/roku_builder/hash.rb
roku_builder-4.29.1 lib/roku_builder/hash.rb
roku_builder-4.28.0 lib/roku_builder/hash.rb
roku_builder-4.27.2 lib/roku_builder/hash.rb
roku_builder-4.27.1 lib/roku_builder/hash.rb
roku_builder-4.27.0 lib/roku_builder/hash.rb
roku_builder-4.26.2 lib/roku_builder/hash.rb
roku_builder-4.26.1 lib/roku_builder/hash.rb
roku_builder-4.26.0 lib/roku_builder/hash.rb
roku_builder-4.25.6 lib/roku_builder/hash.rb
roku_builder-4.25.5 lib/roku_builder/hash.rb
roku_builder-4.25.4 lib/roku_builder/hash.rb
roku_builder-4.25.3 lib/roku_builder/hash.rb
roku_builder-4.25.1 lib/roku_builder/hash.rb