Class: Datadog::Core::Remote::Configuration::TargetMap
- Inherits:
-
Hash
- Object
- Hash
- Datadog::Core::Remote::Configuration::TargetMap
- Defined in:
- lib/datadog/core/remote/configuration/target.rb
Overview
TargetMap stores information regarding Configuration::Path and Configuration::Target
Instance Attribute Summary collapse
-
#opaque_backend_state ⇒ Object
readonly
Returns the value of attribute opaque_backend_state.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ TargetMap
constructor
A new instance of TargetMap.
Constructor Details
#initialize ⇒ TargetMap
Returns a new instance of TargetMap.
35 36 37 38 39 40 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 35 def initialize super @opaque_backend_state = nil @version = nil end |
Instance Attribute Details
#opaque_backend_state ⇒ Object (readonly)
Returns the value of attribute opaque_backend_state.
33 34 35 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 33 def opaque_backend_state @opaque_backend_state end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
33 34 35 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 33 def version @version end |
Class Method Details
.parse(hash) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 13 def parse(hash) opaque_backend_state = hash['signed']['custom']['opaque_backend_state'] version = hash['signed']['version'] map = new map.instance_eval do @opaque_backend_state = opaque_backend_state @version = version end hash['signed']['targets'].each_with_object(map) do |(p, t), m| path = Configuration::Path.parse(p) target = Configuration::Target.parse(t) m[path] = target end end |