class EmailHunter::Api
Main API client for EmailHunter
services
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/email_hunter/api.rb, line 44 def account execute_hunt(Account) end
Account
Information API
Source
# File lib/email_hunter/api.rb, line 49 def company(domain) execute_hunt(Company, domain) end
Company
Information API
Source
# File lib/email_hunter/api.rb, line 39 def count(domain) execute_hunt(Count, domain) end
Email Count
API
Source
# File lib/email_hunter/api.rb, line 24 def exist(email) execute_hunt(Exist, email) end
Email exist API
Source
# File lib/email_hunter/api.rb, line 34 def finder(domain, first_name, last_name) EmailHunter::Finder.new(domain, first_name, last_name, key).hunt end
Email Finder
API
Source
# File lib/email_hunter/api.rb, line 54 def people(domain) execute_hunt(People, domain) end
People
Information API
Source
# File lib/email_hunter/api.rb, line 19 def search(domain, params = {}) execute_hunt(Search, domain, params) end
Domain search API
Source
# File lib/email_hunter/api.rb, line 29 def verify(email) execute_hunt(Verify, email) end
Email verify API
Private Instance Methods
Source
# File lib/email_hunter/api.rb, line 61 def execute_hunt(klass, *args) case klass.name.split('::').last when 'Search' # Search expects (domain, key, params) domain, params = args klass.new(domain, key, params || {}).hunt when 'Count' # Count doesn't need key domain = args.first klass.new(domain).hunt when 'Account' # Account only needs key klass.new(key).hunt else # Other classes expect (value, key) value = args.first klass.new(value, key).hunt end end
Helper method to reduce repetition