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.
59 60 61 62 63 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 59 def initialize(digests:, length:, version:) @digests = digests @length = length @version = version end |
Instance Attribute Details
#digests ⇒ Object (readonly)
Returns the value of attribute digests.
57 58 59 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 57 def digests @digests end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
57 58 59 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 57 def length @length end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
57 58 59 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 57 def version @version end |
Class Method Details
.parse(hash) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 48 def parse(hash) length = Integer(hash['length']) digests = Configuration::DigestList.parse(hash['hashes']) version = Integer(hash['custom']['v']) new(digests: digests, length: length, version: version) end |
Instance Method Details
#check(content) ⇒ Object
67 68 69 |
# File 'lib/datadog/core/remote/configuration/target.rb', line 67 def check(content) digests.check(content) end |