Class: Datadog::Core::Remote::Configuration::Repository::ChangeSet
- Inherits:
-
Array
- Object
- Array
- Datadog::Core::Remote::Configuration::Repository::ChangeSet
- Defined in:
- lib/datadog/core/remote/configuration/repository.rb
Overview
Store list of Changes
Instance Method Summary collapse
- #add(path, previous, content) ⇒ Object
- #deleted(path, previous) ⇒ Object
- #inserted(path, content) ⇒ Object
- #paths ⇒ Object
- #updated(path, content, previous) ⇒ Object
Instance Method Details
#add(path, previous, content) ⇒ Object
270 271 272 273 274 275 276 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 270 def add(path, previous, content) return if previous.nil? && content.nil? return deleted(path, previous) if previous && content.nil? return inserted(path, content) if content && previous.nil? return updated(path, content, previous) if content && previous end |
#deleted(path, previous) ⇒ Object
278 279 280 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 278 def deleted(path, previous) self << Change::Deleted.new(path, previous).freeze end |
#inserted(path, content) ⇒ Object
282 283 284 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 282 def inserted(path, content) self << Change::Inserted.new(path, content).freeze end |
#paths ⇒ Object
266 267 268 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 266 def paths map(&:path) end |