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.209.6 lib/instana/snapshot/deltable.rb
instana-1.209.5 lib/instana/snapshot/deltable.rb
instana-1.209.4 lib/instana/snapshot/deltable.rb
instana-1.209.3 lib/instana/snapshot/deltable.rb
instana-1.209.2 lib/instana/snapshot/deltable.rb
instana-1.209.1 lib/instana/snapshot/deltable.rb
instana-1.209.0.pre3 lib/instana/snapshot/deltable.rb
instana-1.209.0.pre2 lib/instana/snapshot/deltable.rb
instana-1.209.0.pre1 lib/instana/snapshot/deltable.rb
instana-1.208.0 lib/instana/snapshot/deltable.rb
instana-1.207.0 lib/instana/snapshot/deltable.rb
instana-1.206.0 lib/instana/snapshot/deltable.rb
instana-1.205.0 lib/instana/snapshot/deltable.rb
instana-1.204.0 lib/instana/snapshot/deltable.rb
instana-1.204.0.pre3 lib/instana/snapshot/deltable.rb
instana-1.204.0.pre2 lib/instana/snapshot/deltable.rb
instana-1.204.0.pre1 lib/instana/snapshot/deltable.rb
instana-1.203.2 lib/instana/snapshot/deltable.rb
instana-1.203.1 lib/instana/snapshot/deltable.rb
instana-1.203.0 lib/instana/snapshot/deltable.rb