Class: Zonesync::Sync

Inherits:
Struct
  • Object
show all
Defined in:
lib/zonesync.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#destinationObject

Returns the value of attribute destination

Returns:

  • (Object)

    the current value of destination



32
33
34
# File 'lib/zonesync.rb', line 32

def destination
  @destination
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



32
33
34
# File 'lib/zonesync.rb', line 32

def source
  @source
end

Instance Method Details

#call(dry_run: false) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/zonesync.rb', line 33

def call dry_run: false
  source = Provider.from(self.source)
  destination = Provider.from(self.destination)
  operations = Diff.call(from: destination, to: source)
  operations.each do |method, args|
    Logger.log(method, args, dry_run: dry_run)
    destination.send(method, *args) unless dry_run
  end
end