class EmailHunter::Verify

Attributes

accept_all[R]
disposable[R]
email[R]
gibberish[R]
key[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 13
def initialize(email, key)
  @email = email
  @key = key
end

Public Instance Methods

data() click to toggle source
# 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() click to toggle source
# File lib/email_hunter/verify.rb, line 18
def hunt
  Struct.new(*data.keys).new(*data.values)
end