class EmailHunter::Account
Constants
- API_URL
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/email_hunter/account.rb, line 17 def hunt response = fetch_account_data parse_response(response) end
Private Instance Methods
Source
# File lib/email_hunter/account.rb, line 24 def fetch_account_data connection = Faraday.new connection.get(API_URL, api_key: @key) end
Source
# File lib/email_hunter/account.rb, line 29 def parse_response(response) return nil unless response.success? data = JSON.parse(response.body, symbolize_names: true) return nil if data.empty? Struct.new(*data.keys).new(*data.values) end