Class: DnsMadeEasy::Zone::Serializer
- Inherits:
-
Object
- Object
- DnsMadeEasy::Zone::Serializer
- Defined in:
- lib/dnsmadeeasy/zone/serializer.rb
Overview
Emits deterministic, normalized zone-file text.
Instance Method Summary collapse
-
#initialize(zone_file, omit_apex_ns: true) ⇒ Serializer
constructor
A new instance of Serializer.
- #to_s ⇒ Object
Constructor Details
#initialize(zone_file, omit_apex_ns: true) ⇒ Serializer
Returns a new instance of Serializer.
9 10 11 12 |
# File 'lib/dnsmadeeasy/zone/serializer.rb', line 9 def initialize(zone_file, omit_apex_ns: true) @zone_file = zone_file @omit_apex_ns = omit_apex_ns end |
Instance Method Details
#to_s ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/dnsmadeeasy/zone/serializer.rb', line 14 def to_s lines = [ "$ORIGIN #{zone_file.origin}", "$TTL #{zone_file.ttl}", '' ] lines.concat(serialized_records) "#{lines.join("\n")}\n" end |