class EmailHunter::Verify

Attributes

accept_all[R]
disposable[R]
gibberish[R]
meta[R]
mx_records[R]
regexp[R]
result[R]
score[R]
smtp_check[R]
smtp_server[R]
sources[R]
webmail[R]

Public Class Methods

new(email, key) click to toggle source
# File lib/email_hunter/verify.rb, line 12
def initialize(email, key)
  @email = email
  @key = key
end

Public Instance Methods

hunt() click to toggle source
# File lib/email_hunter/verify.rb, line 17
def hunt
  response = apiresponse
  Struct.new(*response.keys).new(*response.values) unless response.empty?
end

Private Instance Methods

apiresponse() click to toggle source
# File lib/email_hunter/verify.rb, line 24
def apiresponse
  response = Faraday.new("#{API_VERIFY_URL}email=#{@email}&api_key=#{@key}").get
  response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
end