Class: Postmark::SpamCheck::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/postmark/spam_check/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email) ⇒ Report

Returns a new instance of Report.



7
8
9
10
11
12
# File 'lib/postmark/spam_check/report.rb', line 7

def initialize(email)
  @email = email
  @score = nil
  @error = nil
  @details = []
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



4
5
6
# File 'lib/postmark/spam_check/report.rb', line 4

def details
  @details
end

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/postmark/spam_check/report.rb', line 4

def email
  @email
end

#errorObject

Returns the value of attribute error.



5
6
7
# File 'lib/postmark/spam_check/report.rb', line 5

def error
  @error
end

#scoreObject (readonly)

Returns the value of attribute score.



4
5
6
# File 'lib/postmark/spam_check/report.rb', line 4

def score
  @score
end

Instance Method Details

#load_results(results) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/postmark/spam_check/report.rb', line 14

def load_results(results)
  # Truthy success means the report was generated successfully.
  if results['success']
    results_for_success(results)
  else
    results_for_failure(results)
  end

  self
end