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
Defined Under Namespace
Modules: ApplyState
Instance Attribute Summary collapse
-
#apply_error ⇒ Object
readonly
Returns the value of attribute apply_error.
-
#apply_state ⇒ Object
readonly
Returns the value of attribute apply_state.
-
#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.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#applied ⇒ Object
Sets this configuration as successfully applied.
-
#errored(error_message) ⇒ Object
Sets this configuration as not successfully applied, with a message describing the error.
- #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.
24 25 26 27 28 29 30 31 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 24 def initialize(path:, data:) @path = path @data = data @apply_state = ApplyState::UNACKNOWLEDGED @apply_error = nil @hashes = {} @version = 0 end |
Instance Attribute Details
#apply_error ⇒ Object (readonly)
Returns the value of attribute apply_error.
21 22 23 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 21 def apply_error @apply_error end |
#apply_state ⇒ Object (readonly)
Returns the value of attribute apply_state.
21 22 23 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 21 def apply_state @apply_state end |
#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 |
#version ⇒ Object
Returns the value of attribute version.
22 23 24 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 22 def version @version end |
Class Method Details
Instance Method Details
#applied ⇒ Object
Sets this configuration as successfully applied.
42 43 44 45 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 42 def applied @apply_state = ApplyState::ACKNOWLEDGED @apply_error = nil end |
#errored(error_message) ⇒ Object
Sets this configuration as not successfully applied, with a message describing the error.
49 50 51 52 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 49 def errored() @apply_state = ApplyState::ERROR @apply_error = end |
#hexdigest(type) ⇒ Object
33 34 35 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 33 def hexdigest(type) @hashes[type] || compute_and_store_hash(type) end |
#length ⇒ Object
37 38 39 |
# File 'lib/datadog/core/remote/configuration/content.rb', line 37 def length @length ||= @data.size end |