Class: Dmarcer::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/dmarcer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

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_domainsObject



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_domainsObject



136
137
138
# File 'lib/dmarcer.rb', line 136

def auth_failed_spf_domains
  auth_failure_domains_by_record_type(:spf)
end

#countObject



120
121
122
# File 'lib/dmarcer.rb', line 120

def count
  @data.row.count
end

#dkim?Boolean

Returns:

  • (Boolean)


108
109
110
# File 'lib/dmarcer.rb', line 108

def dkim?
  @data.auth_results.respond_to?('dkim')
end

#dkim_domainsObject



124
125
126
# File 'lib/dmarcer.rb', line 124

def dkim_domains
  domains_by_record_type(:dkim)
end

#header_fromObject



116
117
118
# File 'lib/dmarcer.rb', line 116

def header_from
  @data.identifiers.header_from.content
end

#policy_evalObject



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_ipObject



112
113
114
# File 'lib/dmarcer.rb', line 112

def source_ip
  @data.row.source_ip.content
end

#spf?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/dmarcer.rb', line 104

def spf?
  @data.auth_results.respond_to?('spf')
end

#spf_domainsObject



128
129
130
# File 'lib/dmarcer.rb', line 128

def spf_domains
  domains_by_record_type(:spf)
end