Class: Deliverable::Result
- Inherits:
-
Object
- Object
- Deliverable::Result
- Defined in:
- lib/deliverable/result.rb
Instance Attribute Summary collapse
-
#checks ⇒ Object
readonly
Returns the value of attribute checks.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#score_details ⇒ Object
readonly
Returns the value of attribute score_details.
-
#smtp_response ⇒ Object
readonly
Returns the value of attribute smtp_response.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #classification ⇒ Object
-
#initialize(email:, score:, score_details:, classification:, errors:, warnings:, checks:, smtp_response: nil, retryable: false) ⇒ Result
constructor
A new instance of Result.
- #retryable? ⇒ Boolean (also: #retryable)
- #to_h ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(email:, score:, score_details:, classification:, errors:, warnings:, checks:, smtp_response: nil, retryable: false) ⇒ Result
Returns a new instance of Result.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/deliverable/result.rb', line 5 def initialize(email:, score:, score_details:, classification:, errors:, warnings:, checks:, smtp_response: nil, retryable: false) @email = email @score = score @score_details = score_details @classification = classification @errors = errors @warnings = warnings @checks = checks @smtp_response = smtp_response @retryable = retryable end |
Instance Attribute Details
#checks ⇒ Object (readonly)
Returns the value of attribute checks.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def checks @checks end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def email @email end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def errors @errors end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def score @score end |
#score_details ⇒ Object (readonly)
Returns the value of attribute score_details.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def score_details @score_details end |
#smtp_response ⇒ Object (readonly)
Returns the value of attribute smtp_response.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def smtp_response @smtp_response end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
3 4 5 |
# File 'lib/deliverable/result.rb', line 3 def warnings @warnings end |
Instance Method Details
#classification ⇒ Object
21 22 23 |
# File 'lib/deliverable/result.rb', line 21 def classification @classification end |
#retryable? ⇒ Boolean Also known as: retryable
25 26 27 |
# File 'lib/deliverable/result.rb', line 25 def retryable? @retryable end |
#to_h ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/deliverable/result.rb', line 30 def to_h { email: @email, valid: valid?, classification: @classification, score: @score, score_details: @score_details, errors: @errors, warnings: @warnings, retryable: @retryable, smtp_response: @smtp_response, checks: @checks } end |
#valid? ⇒ Boolean
17 18 19 |
# File 'lib/deliverable/result.rb', line 17 def valid? @classification != "invalid" end |