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 reporistory 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.
157 158 159 160 161 162 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 157 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.
155 156 157 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 155 def content @content end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
155 156 157 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 155 def path @path end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
155 156 157 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 155 def target @target end |
Instance Method Details
#apply(repository) ⇒ Object
164 165 166 167 168 169 170 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 164 def apply(repository) return unless repository[@path].nil? repository.contents << @content @path end |