Class: Datadog::Core::Remote::Configuration::Content
- Inherits:
-
Object
- Object
- Datadog::Core::Remote::Configuration::Content
- Defined in:
- lib/datadog/core/remote/configuration/content.rb
Overview
Content stores the information associated with a specific Configuration::Path
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#hashes ⇒ Object
readonly
Returns the value of attribute hashes.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #hexdigest(type) ⇒ Object
-
#initialize(path:, data:) ⇒ Content
constructor
A new instance of Content.
- #length ⇒ Object
Constructor Details
#initialize(path:, data:) ⇒ Content
Returns a new instance of Content.
23 24 25 26 27 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 23 def initialize(path:, data:) @path = path @data = data @hashes = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
21 22 23 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 21 def data @data end |
#hashes ⇒ Object (readonly)
Returns the value of attribute hashes.
21 22 23 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 21 def hashes @hashes end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
21 22 23 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 21 def path @path end |
Class Method Details
Instance Method Details
#hexdigest(type) ⇒ Object
29 30 31 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 29 def hexdigest(type) @hashes[type] || compute_and_store_hash(type) end |
#length ⇒ Object
33 34 35 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 33 def length @length ||= @data.size end |