class EmailHunter::Account

Attributes

calls[R]
email[R]
first_name[R]
last_name[R]
plan_level[R]
plan_name[R]
requests[R]
reset_date[R]
result[R]
team_id[R]

Public Class Methods

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

Public Instance Methods

hunt() click to toggle source
# File lib/email_hunter/account.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/account.rb, line 24
def apiresponse
  response = Faraday.new("#{API_ACCOUNT_URL}&api_key=#{@key}").get
  response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
end