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.202.0 lib/instana/snapshot/deltable.rb
instana-1.201.0 lib/instana/snapshot/deltable.rb
instana-1.201.0.pre1 lib/instana/snapshot/deltable.rb
instana-1.200.0 lib/instana/snapshot/deltable.rb
instana-1.200.0.pre1 lib/instana/snapshot/deltable.rb
instana-1.199.6 lib/instana/snapshot/deltable.rb
instana-1.199.5 lib/instana/snapshot/deltable.rb
instana-1.199.4 lib/instana/snapshot/deltable.rb
instana-1.199.3 lib/instana/snapshot/deltable.rb
instana-1.199.2 lib/instana/snapshot/deltable.rb
instana-1.199.1 lib/instana/snapshot/deltable.rb
instana-1.199.0 lib/instana/snapshot/deltable.rb
instana-1.198.0 lib/instana/snapshot/deltable.rb
instana-1.198.0.pre1 lib/instana/snapshot/deltable.rb
instana-1.197.0 lib/instana/snapshot/deltable.rb
instana-1.197.0.pre2 lib/instana/snapshot/deltable.rb
instana-1.197.0.pre1 lib/instana/snapshot/deltable.rb