Class: RedZone::ZonefileWriter
- Inherits:
-
Object
- Object
- RedZone::ZonefileWriter
- Defined in:
- lib/redzone/zonefile_writer.rb
Overview
Writes zone configurations to files
Instance Method Summary collapse
-
#initialize(zone_config) ⇒ ZonefileWriter
constructor
Constructs a ZonefileWriter.
-
#write_zones(target) ⇒ Object
Write the zone database files to the target folder.
Constructor Details
#initialize(zone_config) ⇒ ZonefileWriter
Constructs a ZonefileWriter
8 9 10 |
# File 'lib/redzone/zonefile_writer.rb', line 8 def initialize(zone_config) @config = zone_config end |
Instance Method Details
#write_zones(target) ⇒ Object
Write the zone database files to the target folder
13 14 15 16 17 18 19 20 21 |
# File 'lib/redzone/zonefile_writer.rb', line 13 def write_zones(target) raise ArgumentError, "Directory #{target} does not exist" unless target.exist? @config.zones.each do |z| with_file(target,z.name) { |io| z.write(io) } end @config.arpas.each do |a| with_file(target,a.name) {|io| a.write(io)} end end |