Class: Glare::CfDnsRecords::Updater

Inherits:
Object
  • Object
show all
Defined in:
lib/glare/cf_dns_records/updater.rb

Defined Under Namespace

Classes: Operation, Operations

Instance Method Summary collapse

Constructor Details

#initialize(current_records, new_contents) ⇒ Updater

Returns a new instance of Updater.



44
45
46
47
# File 'lib/glare/cf_dns_records/updater.rb', line 44

def initialize(current_records, new_contents)
  @current_records = current_records.dup
  @new_contents = new_contents.dup
end

Instance Method Details

#calculateObject



49
50
51
52
53
54
55
56
57
58
# File 'lib/glare/cf_dns_records/updater.rb', line 49

def calculate
  drop_same_records

  operations = Operations.new
  operations.add_updates(updated_records)
  operations.add_insertions(new_records)
  operations.add_deletions(deleted_records)

  operations
end