Class: Dmarcer::Record
- Inherits:
-
Object
- Object
- Dmarcer::Record
- Defined in:
- lib/dmarcer.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #auth_failed_dkim_domains ⇒ Object
- #auth_failed_spf_domains ⇒ Object
- #count ⇒ Object
- #dkim? ⇒ Boolean
- #dkim_domains ⇒ Object
- #header_from ⇒ Object
-
#initialize(data) ⇒ Record
constructor
A new instance of Record.
- #policy_eval ⇒ Object
- #source_ip ⇒ Object
- #spf? ⇒ Boolean
- #spf_domains ⇒ Object
Constructor Details
#initialize(data) ⇒ Record
Returns a new instance of Record.
100 101 102 |
# File 'lib/dmarcer.rb', line 100 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
98 99 100 |
# File 'lib/dmarcer.rb', line 98 def data @data end |
Instance Method Details
#auth_failed_dkim_domains ⇒ Object
132 133 134 |
# File 'lib/dmarcer.rb', line 132 def auth_failed_dkim_domains auth_failure_domains_by_record_type(:dkim) end |
#auth_failed_spf_domains ⇒ Object
136 137 138 |
# File 'lib/dmarcer.rb', line 136 def auth_failed_spf_domains auth_failure_domains_by_record_type(:spf) end |
#count ⇒ Object
120 121 122 |
# File 'lib/dmarcer.rb', line 120 def count @data.row.count end |
#dkim? ⇒ Boolean
108 109 110 |
# File 'lib/dmarcer.rb', line 108 def dkim? @data.auth_results.respond_to?('dkim') end |
#dkim_domains ⇒ Object
124 125 126 |
# File 'lib/dmarcer.rb', line 124 def dkim_domains domains_by_record_type(:dkim) end |
#header_from ⇒ Object
116 117 118 |
# File 'lib/dmarcer.rb', line 116 def header_from @data.identifiers.header_from.content end |
#policy_eval ⇒ Object
140 141 142 143 144 145 146 147 |
# File 'lib/dmarcer.rb', line 140 def policy_eval p = @data.row.policy_evaluated { disposition: p.disposition.content, dkim: p.dkim.content, spf: p.spf.content } end |
#source_ip ⇒ Object
112 113 114 |
# File 'lib/dmarcer.rb', line 112 def source_ip @data.row.source_ip.content end |
#spf? ⇒ Boolean
104 105 106 |
# File 'lib/dmarcer.rb', line 104 def spf? @data.auth_results.respond_to?('spf') end |
#spf_domains ⇒ Object
128 129 130 |
# File 'lib/dmarcer.rb', line 128 def spf_domains domains_by_record_type(:spf) end |