Class: Datadog::Core::Remote::Configuration::Repository::Operation::Insert

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/remote/configuration/repository.rb

Overview

Insert content into the reporistory contents

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



155
156
157
# File 'lib/datadog/core/remote/configuration/repository.rb', line 155

def content
  @content
end

#pathObject (readonly)

Returns the value of attribute path.



155
156
157
# File 'lib/datadog/core/remote/configuration/repository.rb', line 155

def path
  @path
end

#targetObject (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