Class: Datadog::Core::Remote::Configuration::Target
- Inherits:
-
Object
- Object
- Datadog::Core::Remote::Configuration::Target
- Defined in:
- lib/datadog/core/remote/configuration/target.rb
Overview
Target stores digest information
Instance Attribute Summary collapse
-
#digests ⇒ Object
readonly
Returns the value of attribute digests.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #check(content) ⇒ Object
-
#initialize(digests:, length:, version:) ⇒ Target
constructor
A new instance of Target.
Constructor Details
#initialize(digests:, length:, version:) ⇒ Target
Returns a new instance of Target.
66 67 68 69 70 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 66 def initialize(digests:, length:, version:) @digests = digests @length = length @version = version end |
Instance Attribute Details
#digests ⇒ Object (readonly)
Returns the value of attribute digests.
64 65 66 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 64 def digests @digests end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
64 65 66 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 64 def length @length end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
64 65 66 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 64 def version @version end |
Class Method Details
.parse(hash) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 55 def parse(hash) length = Integer(hash.fetch('length')) digests = Configuration::DigestList.parse(hash.fetch('hashes')) version = Integer(hash.dig('custom', 'v')) new(digests: digests, length: length, version: version) end |
Instance Method Details
#check(content) ⇒ Object
74 75 76 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 74 def check(content) digests.check(content) end |