Class: DmarcParser::Metadata

Inherits:
Object
  • Object
show all
Includes:
XmlHelper
Defined in:
lib/dmarc_parser/metadata.rb

Constant Summary collapse

ATTRIBUTES =
[:org_name, :email, :extra_contact_info, :report_id, :begin_at, :end_at]

Instance Method Summary collapse

Methods included from XmlHelper

#get_int, #get_text, #get_timestamp

Constructor Details

#initialize(node) ⇒ Metadata

Returns a new instance of Metadata.



14
15
16
17
18
19
20
21
22
# File 'lib/dmarc_parser/metadata.rb', line 14

def initialize(node)
  @node = node
  self.org_name = get_text("feedback/report_metadata/org_name")
  self.email = get_text("feedback/report_metadata/email")
  self.extra_contact_info = get_text("feedback/report_metadata/extra_contact_info")
  self.report_id = get_text("feedback/report_metadata/report_id")
  self.begin_at = get_timestamp("feedback/report_metadata/date_range/begin")
  self.end_at = get_timestamp("feedback/report_metadata/date_range/end")
end