Class: DmarcParser::Report
- Inherits:
-
Object
- Object
- DmarcParser::Report
- Defined in:
- lib/dmarc_parser/report.rb
Instance Method Summary collapse
-
#initialize(xml) ⇒ Report
constructor
A new instance of Report.
- #metadata ⇒ Object
- #policy ⇒ Object
- #records ⇒ Object
Constructor Details
#initialize(xml) ⇒ Report
Returns a new instance of Report.
8 9 10 11 |
# File 'lib/dmarc_parser/report.rb', line 8 def initialize(xml) @xml = xml @node = Nokogiri::XML(xml) end |
Instance Method Details
#metadata ⇒ Object
13 14 15 |
# File 'lib/dmarc_parser/report.rb', line 13 def @metadata ||= DmarcParser::Metadata.new(@node) end |
#policy ⇒ Object
17 18 19 |
# File 'lib/dmarc_parser/report.rb', line 17 def policy @policy ||=DmarcParser::Policy.new(@node) end |
#records ⇒ Object
21 22 23 24 25 |
# File 'lib/dmarc_parser/report.rb', line 21 def records @records ||= @node.xpath('feedback/record').map do |node| DmarcParser::Record.new(node) end end |