Module: Zerobounce::Response::V1Response
- Defined in:
- lib/zerobounce/response/v1_response.rb
Overview
V1 specific methods for the API.
Instance Method Summary collapse
-
#creation_date ⇒ Time?
The creation date of the email when available.
-
#disposable? ⇒ Boolean
If the email domain is disposable, which are usually temporary email addresses.
-
#location ⇒ String?
The location of the owner of the email when available.
-
#processed_at ⇒ Time?
The UTC time the email was validated.
-
#status ⇒ Symbol
Deliverability status.
-
#sub_status ⇒ Symbol
A more detailed status.
-
#toxic? ⇒ Boolean
These domains are known for abuse, spam, or are bot created.
Instance Method Details
#creation_date ⇒ Time?
The creation date of the email when available.
91 92 93 |
# File 'lib/zerobounce/response/v1_response.rb', line 91 def creation_date @creation_date ||= @body[:creationdate] && Time.parse("#{@body[:creationdate]} UTC") end |
#disposable? ⇒ Boolean
If you have valid emails with this flag set to true
, you shouldn’t email them.
If the email domain is disposable, which are usually temporary email addresses.
These are temporary emails created for the sole purpose to sign up to websites without giving their real email address. These emails are short lived from 15 minutes to around 6 months.
61 62 63 |
# File 'lib/zerobounce/response/v1_response.rb', line 61 def disposable? @disposable ||= @body[:disposable] || false end |
#location ⇒ String?
The location of the owner of the email when available.
77 78 79 |
# File 'lib/zerobounce/response/v1_response.rb', line 77 def location @location ||= @body[:location] end |
#processed_at ⇒ Time?
The UTC time the email was validated.
84 85 86 |
# File 'lib/zerobounce/response/v1_response.rb', line 84 def processed_at @processed_at ||= @body[:processedat] && Time.parse("#{@body[:processedat]} UTC") end |
#status ⇒ Symbol
Deliverability status
Possible values:
:valid
:invalid
:catch_all
:unknown
:spamtrap
:abuse
:do_not_mail
19 20 21 |
# File 'lib/zerobounce/response/v1_response.rb', line 19 def status @status ||= @body[:status].to_s.empty? ? nil : underscore(@body[:status]).to_sym end |
#sub_status ⇒ Symbol
A more detailed status
Possible values:
:antispam_system
:greylisted
:mail_server_temporary_error
:forcible_disconnect
:mail_server_did_not_respond
:timeout_exceeded
:failed_smtp_connection
:mailbox_quota_exceeded
:exception_occurred
:possible_traps
:role_based
:global_suppression
:mailbox_not_found
:no_dns_entries
:failed_syntax_check
:possible_typo
:unroutable_ip_address
:leading_period_removed
:does_not_accept_mail
:alias_address
:unknown
49 50 51 |
# File 'lib/zerobounce/response/v1_response.rb', line 49 def sub_status @sub_status ||= @body[:sub_status].to_s.empty? ? nil : underscore(@body[:sub_status]).to_sym end |
#toxic? ⇒ Boolean
If you have a valid email with this flag set to true
, you shouldn’t email them.
These domains are known for abuse, spam, or are bot created.
70 71 72 |
# File 'lib/zerobounce/response/v1_response.rb', line 70 def toxic? @toxic ||= @body[:toxic] || false end |