Class: Datadog::Core::Remote::Configuration::Repository::Operation::Update
- Inherits:
-
Object
- Object
- Datadog::Core::Remote::Configuration::Repository::Operation::Update
- Defined in:
- lib/datadog/core/remote/configuration/repository.rb
Overview
Update existimng repository’s contents
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #apply(repository) ⇒ Object
-
#initialize(path, target, content) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(path, target, content) ⇒ Update
Returns a new instance of Update.
192 193 194 195 196 197 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 192 def initialize(path, target, content) super() @path = path @target = target @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
190 191 192 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 190 def content @content end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
190 191 192 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 190 def path @path end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
190 191 192 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 190 def target @target end |
Instance Method Details
#apply(repository) ⇒ Object
199 200 201 202 203 204 205 206 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 199 def apply(repository) return if repository[@path].nil? @content.version = @target.version repository.contents[@path] = @content @path end |