Class: Datadog::Core::Remote::Configuration::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/remote/configuration/target.rb

Overview

Target stores digest information

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(digests:, length:) ⇒ Target

Returns a new instance of Target.



58
59
60
61
# File 'lib/datadog/core/remote/configuration/target.rb', line 58

def initialize(digests:, length:)
  @digests = digests
  @length = length
end

Instance Attribute Details

#digestsObject (readonly)

Returns the value of attribute digests.



56
57
58
# File 'lib/datadog/core/remote/configuration/target.rb', line 56

def digests
  @digests
end

#lengthObject (readonly)

Returns the value of attribute length.



56
57
58
# File 'lib/datadog/core/remote/configuration/target.rb', line 56

def length
  @length
end

Class Method Details

.parse(hash) ⇒ Object



48
49
50
51
52
53
# File 'lib/datadog/core/remote/configuration/target.rb', line 48

def parse(hash)
  length = Integer(hash['length'])
  digests = Configuration::DigestList.parse(hash['hashes'])

  new(digests: digests, length: length)
end

Instance Method Details

#check(content) ⇒ Object



65
66
67
# File 'lib/datadog/core/remote/configuration/target.rb', line 65

def check(content)
  digests.check(content)
end