Class: DmarcParser::Policy

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

Constant Summary collapse

ATTRIBUTES =
[:domain, :adkim, :aspf, :p, :sp, :pct]

Instance Method Summary collapse

Methods included from XmlHelper

#get_int, #get_text, #get_timestamp

Constructor Details

#initialize(node) ⇒ Policy

Returns a new instance of Policy.



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

def initialize(node)
  @node = node
  ATTRIBUTES.each do |attr|
    self.send("#{attr}=", get_text("feedback/policy_published/#{attr}"))
  end
  self.pct = self.pct ? self.pct.to_i : nil
end