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
282 283 284 285 286 287 288 289 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 282 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? updated(path, content, previous) if content && previous end |
#deleted(path, previous) ⇒ Object
291 292 293 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 291 def deleted(path, previous) self << Change::Deleted.new(path, previous).freeze end |
#inserted(path, content) ⇒ Object
295 296 297 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 295 def inserted(path, content) self << Change::Inserted.new(path, content).freeze end |
#paths ⇒ Object
278 279 280 |
# File 'lib/datadog/core/remote/configuration/repository.rb', line 278 def paths map(&:path) end |