Class: Datadog::Core::Remote::Configuration::Repository::Operation::Delete
- Inherits:
-
Object
- Object
- Datadog::Core::Remote::Configuration::Repository::Operation::Delete
- Defined in:
- lib/datadog/core/remote/configuration/repository.rb
Overview
Delete contents base on path
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #apply(repository) ⇒ Object
-
#initialize(path) ⇒ Delete
constructor
A new instance of Delete.
Constructor Details
#initialize(path) ⇒ Delete
Returns a new instance of Delete.
139 140 141 142 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 139 def initialize(path) super() @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
137 138 139 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 137 def path @path end |
Instance Method Details
#apply(repository) ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 144 def apply(repository) return if repository[@path].nil? repository.contents.delete(@path) @path end |