Module: Zonesync::Zonefile

Defined in:
lib/zonesync/zonefile.rb

Defined Under Namespace

Classes: A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, ParsingError, Record, SOA, SPF, SRV, SSHFP, TXT, UnknownRecordType, Zone

Class Method Summary collapse

Class Method Details

.load(zone_string, alternate_origin = nil) ⇒ Object



14
15
16
# File 'lib/zonesync/zonefile.rb', line 14

def load(zone_string, alternate_origin = nil)
  Zone.new(parse(zone_string).entries, alternate_origin)
end

.parse(zone_string) ⇒ Object

Raises:



7
8
9
10
11
12
# File 'lib/zonesync/zonefile.rb', line 7

def parse(zone_string)
  parser = ZonefileParser.new
  result = parser.parse(zone_string)
  return result if result
  raise ParsingError, parser.failure_reason
end