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

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

Overview

Update existimng repository’s contents

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, target, content) ⇒ Update

Returns a new instance of Update.



177
178
179
180
181
182
# File 'lib/datadog/core/remote/configuration/repository.rb', line 177

def initialize(path, target, content)
  super()
  @path = path
  @target = target
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



175
176
177
# File 'lib/datadog/core/remote/configuration/repository.rb', line 175

def content
  @content
end

#pathObject (readonly)

Returns the value of attribute path.



175
176
177
# File 'lib/datadog/core/remote/configuration/repository.rb', line 175

def path
  @path
end

#targetObject (readonly)

Returns the value of attribute target.



175
176
177
# File 'lib/datadog/core/remote/configuration/repository.rb', line 175

def target
  @target
end

Instance Method Details

#apply(repository) ⇒ Object



184
185
186
187
188
189
190
# File 'lib/datadog/core/remote/configuration/repository.rb', line 184

def apply(repository)
  return if repository[@path].nil?

  repository.contents[@path] = @content

  @path
end