Module: Instana::Snapshot::Deltable
- Included in:
- DockerContainer
- Defined in:
- lib/instana/snapshot/deltable.rb
Overview
Instance Method Summary collapse
Instance Method Details
#delta(key, *rest, compute:, obj:, path: [key, *rest]) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/instana/snapshot/deltable.rb', line 8 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 |