Sha256: 66d0ae15d62bc8a6ef6daf3c647cb10513456254c9ccc5f0c4c766d1ea3e91fe
Contents?: true
Size: 571 Bytes
Versions: 57
Compression:
Stored size: 571 Bytes
Contents
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2021 module Instana module Snapshot # @since 1.197.0 module Deltable def delta(key, *rest, compute:, obj:, path: [key, *rest]) val = obj[key] return val if val == nil if rest.empty? @__delta ||= Hash.new(0) cache_key = path.join('.') old = @__delta[cache_key] @__delta[cache_key] = val return compute.call(old, val) end delta(*rest, compute: compute, obj: val, path: path) end end end end
Version data entries
57 entries across 57 versions & 1 rubygems