class DMARCInspector::DMARC::Record

Public Class Methods

parse(raw) click to toggle source
# File lib/dmarc_inspector/dmarc/record.rb, line 7
def self.parse(raw)
  begin
    tree = Parser.parse(raw)
  rescue Parslet::ParseFailed
    raise InvalidRecord
  end

  tree[:p] = tree[:p].to_sym
  tree
end