Class: RactorDNS::ActiveZone::Zone

Inherits:
ActiveZone::Provider::Zone
  • Object
show all
Defined in:
lib/ractor_dns/active_zone/zone.rb

Instance Method Summary collapse

Instance Method Details

#delete!Object



13
14
15
16
17
18
19
20
# File 'lib/ractor_dns/active_zone/zone.rb', line 13

def delete!
  t = RactorDNS::Transaction.new do |zc|
    zc.delete(name)
  end
  provider.zones.transact t
  @persisted = false
  freeze
end

#persist!Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/ractor_dns/active_zone/zone.rb', line 2

def persist!
  t = RactorDNS::Transaction.new do |zc|
    zc[name] = resources.map(&:to_h)
  end
  
  provider.zones.transact t

  @persisted = true
  changes_applied
end

#providerObject



22
23
24
# File 'lib/ractor_dns/active_zone/zone.rb', line 22

def provider
  @@provider
end