Class: Datadog::Core::Remote::Configuration::Repository::Operation::Insert
- Inherits:
-
Object
- Object
- Datadog::Core::Remote::Configuration::Repository::Operation::Insert
- Defined in:
- lib/datadog/core/remote/configuration/repository.rb
Overview
Insert content into the repository 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) ⇒ Insert
constructor
A new instance of Insert.
Constructor Details
#initialize(path, target, content) ⇒ Insert
Returns a new instance of Insert.
171 172 173 174 175 176 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 171 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.
169 170 171 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 169 def content @content end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
169 170 171 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 169 def path @path end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
169 170 171 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 169 def target @target end |
Instance Method Details
#apply(repository) ⇒ Object
178 179 180 181 182 183 184 185 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 178 def apply(repository) return unless repository[@path].nil? @content.version = @target.version repository.contents << @content @path end |