Class: EmailHunter::Verify
- Inherits:
-
Object
- Object
- EmailHunter::Verify
- Defined in:
- lib/email_hunter/verify.rb
Instance Attribute Summary collapse
-
#accept_all ⇒ Object
readonly
Returns the value of attribute accept_all.
-
#disposable ⇒ Object
readonly
Returns the value of attribute disposable.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#gibberish ⇒ Object
readonly
Returns the value of attribute gibberish.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#mx_records ⇒ Object
readonly
Returns the value of attribute mx_records.
-
#regexp ⇒ Object
readonly
Returns the value of attribute regexp.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#smtp_check ⇒ Object
readonly
Returns the value of attribute smtp_check.
-
#smtp_server ⇒ Object
readonly
Returns the value of attribute smtp_server.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
-
#webmail ⇒ Object
readonly
Returns the value of attribute webmail.
Instance Method Summary collapse
- #data ⇒ Object
- #hunt ⇒ Object
-
#initialize(email, key) ⇒ Verify
constructor
A new instance of Verify.
Constructor Details
#initialize(email, key) ⇒ Verify
Returns a new instance of Verify.
13 14 15 16 |
# File 'lib/email_hunter/verify.rb', line 13 def initialize(email, key) @email = email @key = key end |
Instance Attribute Details
#accept_all ⇒ Object (readonly)
Returns the value of attribute accept_all.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def accept_all @accept_all end |
#disposable ⇒ Object (readonly)
Returns the value of attribute disposable.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def disposable @disposable end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def email @email end |
#gibberish ⇒ Object (readonly)
Returns the value of attribute gibberish.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def gibberish @gibberish end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def key @key end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def @meta end |
#mx_records ⇒ Object (readonly)
Returns the value of attribute mx_records.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def mx_records @mx_records end |
#regexp ⇒ Object (readonly)
Returns the value of attribute regexp.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def regexp @regexp end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def result @result end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def score @score end |
#smtp_check ⇒ Object (readonly)
Returns the value of attribute smtp_check.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def smtp_check @smtp_check end |
#smtp_server ⇒ Object (readonly)
Returns the value of attribute smtp_server.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def smtp_server @smtp_server end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def sources @sources end |
#webmail ⇒ Object (readonly)
Returns the value of attribute webmail.
10 11 12 |
# File 'lib/email_hunter/verify.rb', line 10 def webmail @webmail end |
Instance Method Details
#data ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/email_hunter/verify.rb', line 22 def data @data ||= begin response = Faraday.new("#{API_VERIFY_URL}email=#{email}&api_key=#{key}").get return [] unless response.success? JSON.parse(response.body, { symbolize_names: true }) end end |
#hunt ⇒ Object
18 19 20 |
# File 'lib/email_hunter/verify.rb', line 18 def hunt Struct.new(*data.keys).new(*data.values) end |