Class: DMARCInspector::DMARC::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/dmarc_inspector/dmarc/record.rb

Class Method Summary collapse

Class Method Details

.parse(raw) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# 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