module DmarcParser::XmlHelper

Public Instance Methods

get_int(xpath) click to toggle source
# File lib/dmarc_parser/xml_helper.rb, line 14
def get_int(xpath)
  value = get_text(xpath)
  value ? value.to_i : nil
end
get_text(xpath) click to toggle source
# File lib/dmarc_parser/xml_helper.rb, line 5
def get_text(xpath)
  @node.xpath(xpath).first.text rescue nil
end
get_timestamp(xpath) click to toggle source
# File lib/dmarc_parser/xml_helper.rb, line 9
def get_timestamp(xpath)
  value = get_text(xpath)
  value ? Time.at(value.to_i) : nil
end