Class: Postio::Models::EmailResult

Inherits:
Data
  • Object
show all
Defined in:
lib/postio/models.rb

Overview

EmailResult — validation verdict for one email address.

Constant Summary collapse

DELIVERABILITY_DELIVERABLE =
"deliverable"
DELIVERABILITY_UNDELIVERABLE =
"undeliverable"
DELIVERABILITY_RISKY =
"risky"
DELIVERABILITY_UNKNOWN =
"unknown"
DELIVERABILITY_INVALID =
"invalid"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#deliverabilityObject (readonly)

Returns the value of attribute deliverability

Returns:

  • (Object)

    the current value of deliverability



85
86
87
# File 'lib/postio/models.rb', line 85

def deliverability
  @deliverability
end

#did_you_meanObject (readonly)

Returns the value of attribute did_you_mean

Returns:

  • (Object)

    the current value of did_you_mean



85
86
87
# File 'lib/postio/models.rb', line 85

def did_you_mean
  @did_you_mean
end

#emailObject (readonly)

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



85
86
87
# File 'lib/postio/models.rb', line 85

def email
  @email
end

#is_catch_allObject (readonly)

Returns the value of attribute is_catch_all

Returns:

  • (Object)

    the current value of is_catch_all



85
86
87
# File 'lib/postio/models.rb', line 85

def is_catch_all
  @is_catch_all
end

#is_disposableObject (readonly)

Returns the value of attribute is_disposable

Returns:

  • (Object)

    the current value of is_disposable



85
86
87
# File 'lib/postio/models.rb', line 85

def is_disposable
  @is_disposable
end

#is_free_providerObject (readonly)

Returns the value of attribute is_free_provider

Returns:

  • (Object)

    the current value of is_free_provider



85
86
87
# File 'lib/postio/models.rb', line 85

def is_free_provider
  @is_free_provider
end

#is_role_accountObject (readonly)

Returns the value of attribute is_role_account

Returns:

  • (Object)

    the current value of is_role_account



85
86
87
# File 'lib/postio/models.rb', line 85

def 
  @is_role_account
end

#is_valid_syntaxObject (readonly)

Returns the value of attribute is_valid_syntax

Returns:

  • (Object)

    the current value of is_valid_syntax



85
86
87
# File 'lib/postio/models.rb', line 85

def is_valid_syntax
  @is_valid_syntax
end

#mx_foundObject (readonly)

Returns the value of attribute mx_found

Returns:

  • (Object)

    the current value of mx_found



85
86
87
# File 'lib/postio/models.rb', line 85

def mx_found
  @mx_found
end

#smtp_checkObject (readonly)

Returns the value of attribute smtp_check

Returns:

  • (Object)

    the current value of smtp_check



85
86
87
# File 'lib/postio/models.rb', line 85

def smtp_check
  @smtp_check
end

Class Method Details

.from_hash(h) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/postio/models.rb', line 95

def self.from_hash(h)
  new(
    email:            h["email"].to_s,
    is_valid_syntax:  h["isValidSyntax"] == true,
    did_you_mean:     h["didYouMean"],
    is_disposable:    h["isDisposable"] == true,
    is_free_provider: h["isFreeProvider"] == true,
    is_role_account:  h["isRoleAccount"] == true,
    mx_found:         h["mxFound"] == true,
    smtp_check:       h["smtpCheck"],
    is_catch_all:     h["isCatchAll"],
    deliverability:   h["deliverability"].to_s
  )
end