Class: MailAuth::ArcResult

Inherits:
Data
  • Object
show all
Defined in:
lib/mailauth/result.rb

Overview

Whether the chain holds, and who sealed it — never whether any of them is to be believed. A chain is cheap to forge over a message of one's own, so trust is the caller's decision and deliberately has no answer here.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, sets: [], oldest_pass: nil, comment: nil) ⇒ ArcResult

Returns a new instance of ArcResult.



77
78
79
# File 'lib/mailauth/result.rb', line 77

def initialize(status:, sets: [], oldest_pass: nil, comment: nil)
  super
end

Instance Attribute Details

#commentObject (readonly)

Returns the value of attribute comment

Returns:

  • (Object)

    the current value of comment



76
77
78
# File 'lib/mailauth/result.rb', line 76

def comment
  @comment
end

#oldest_passObject (readonly)

Returns the value of attribute oldest_pass

Returns:

  • (Object)

    the current value of oldest_pass



76
77
78
# File 'lib/mailauth/result.rb', line 76

def oldest_pass
  @oldest_pass
end

#setsObject (readonly)

Returns the value of attribute sets

Returns:

  • (Object)

    the current value of sets



76
77
78
# File 'lib/mailauth/result.rb', line 76

def sets
  @sets
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



76
77
78
# File 'lib/mailauth/result.rb', line 76

def status
  @status
end

Instance Method Details

#intact?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/mailauth/result.rb', line 90

def intact?
  status == Status::PASS
end

#newestObject



81
82
83
# File 'lib/mailauth/result.rb', line 81

def newest
  sets.max_by(&:instance)
end

#sealersObject

Oldest hop first, the order they sealed in.



86
87
88
# File 'lib/mailauth/result.rb', line 86

def sealers
  sets.sort_by(&:instance).filter_map { |set| set.seal&.domain }
end