Class: Coppertone::Result
- Inherits:
-
Object
- Object
- Coppertone::Result
- Defined in:
- lib/coppertone/result.rb
Overview
The result of an SPF query. Includes a code, which indicates the overall result (pass, fail, softfail, etc.). For different results it may include the mechanism which led to the result, an error message, and/or an explanation string.
Constant Summary collapse
- NONE =
:none- PASS =
:pass- FAIL =
:fail- SOFTFAIL =
:softfail- NEUTRAL =
:neutral- TEMPERROR =
:temperror- PERMERROR =
:permerror
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#explanation ⇒ Object
Returns the value of attribute explanation.
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#mechanism ⇒ Object
readonly
Returns the value of attribute mechanism.
-
#problem ⇒ Object
Returns the value of attribute problem.
Class Method Summary collapse
- .from_directive(directive) ⇒ Object
- .neutral ⇒ Object
- .none ⇒ Object
- .permerror(message) ⇒ Object
- .temperror(message) ⇒ Object
Instance Method Summary collapse
-
#initialize(code, mechanism = nil) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(code, mechanism = nil) ⇒ Result
20 21 22 23 |
# File 'lib/coppertone/result.rb', line 20 def initialize(code, mechanism = nil) @code = code @mechanism = mechanism end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
17 18 19 |
# File 'lib/coppertone/result.rb', line 17 def code @code end |
#explanation ⇒ Object
Returns the value of attribute explanation.
18 19 20 |
# File 'lib/coppertone/result.rb', line 18 def explanation @explanation end |
#identity ⇒ Object
Returns the value of attribute identity.
18 19 20 |
# File 'lib/coppertone/result.rb', line 18 def identity @identity end |
#mechanism ⇒ Object (readonly)
Returns the value of attribute mechanism.
17 18 19 |
# File 'lib/coppertone/result.rb', line 17 def mechanism @mechanism end |
#problem ⇒ Object
Returns the value of attribute problem.
18 19 20 |
# File 'lib/coppertone/result.rb', line 18 def problem @problem end |
Class Method Details
.from_directive(directive) ⇒ Object
25 26 27 |
# File 'lib/coppertone/result.rb', line 25 def self.from_directive(directive) new(directive.qualifier.result_code, directive.mechanism) end |
.neutral ⇒ Object
45 46 47 |
# File 'lib/coppertone/result.rb', line 45 def self.neutral Result.new(:neutral) end |
.none ⇒ Object
41 42 43 |
# File 'lib/coppertone/result.rb', line 41 def self.none Result.new(:none) end |
.permerror(message) ⇒ Object
29 30 31 32 33 |
# File 'lib/coppertone/result.rb', line 29 def self.permerror() r = Result.new(:permerror) r.problem = r end |
.temperror(message) ⇒ Object
35 36 37 38 39 |
# File 'lib/coppertone/result.rb', line 35 def self.temperror() r = Result.new(:temperror) r.problem = r end |