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

Version Path
instana-1.217.1 lib/instana/snapshot/deltable.rb
instana-1.217.0 lib/instana/snapshot/deltable.rb
instana-1.216.0 lib/instana/snapshot/deltable.rb
instana-1.215.1 lib/instana/snapshot/deltable.rb
instana-1.215.0 lib/instana/snapshot/deltable.rb
instana-1.214.4 lib/instana/snapshot/deltable.rb
instana-1.214.3 lib/instana/snapshot/deltable.rb
instana-1.214.2 lib/instana/snapshot/deltable.rb
instana-1.214.1 lib/instana/snapshot/deltable.rb
instana-1.214.0 lib/instana/snapshot/deltable.rb
instana-1.213.3 lib/instana/snapshot/deltable.rb
instana-1.213.2 lib/instana/snapshot/deltable.rb
instana-1.213.1 lib/instana/snapshot/deltable.rb
instana-1.213.0 lib/instana/snapshot/deltable.rb
instana-1.212.0 lib/instana/snapshot/deltable.rb
instana-1.211.0 lib/instana/snapshot/deltable.rb
instana-1.210.1 lib/instana/snapshot/deltable.rb
instana-1.210.0 lib/instana/snapshot/deltable.rb
instana-1.209.8 lib/instana/snapshot/deltable.rb
instana-1.209.7 lib/instana/snapshot/deltable.rb