Class: DnsMadeEasy::Zone::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsmadeeasy/zone/diff.rb

Overview

Builds a conservative execution plan from desired and remote record sets. TTL-only differences are ignored unless compare_ttl is true.

Instance Method Summary collapse

Constructor Details

#initialize(desired_records:, remote_records:, compare_ttl: false) ⇒ Diff

Returns a new instance of Diff.



10
11
12
13
14
# File 'lib/dnsmadeeasy/zone/diff.rb', line 10

def initialize(desired_records:, remote_records:, compare_ttl: false)
  @provider_managed_records, @desired_records = desired_records.partition { |record| provider_managed?(record) }
  @remote_records = remote_records
  @compare_ttl = compare_ttl
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
24
# File 'lib/dnsmadeeasy/zone/diff.rb', line 16

def call
  Plan.new(
    creates: create_actions,
    updates: update_actions,
    skipped_creates: skipped_create_actions,
    skipped_deletes: skipped_delete_actions,
    ambiguous: ambiguous_actions
  )
end