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

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

Overview

Delete contents base on path

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Delete

Returns a new instance of Delete.



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

def initialize(path)
  super()
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



151
152
153
# File 'lib/datadog/core/remote/configuration/repository.rb', line 151

def path
  @path
end

Instance Method Details

#apply(repository) ⇒ Object



158
159
160
161
162
163
164
# File 'lib/datadog/core/remote/configuration/repository.rb', line 158

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

  repository.contents.delete(@path)

  @path
end