Class: EmailHunter::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/email_hunter/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ Api

Returns a new instance of Api.



13
14
15
# File 'lib/email_hunter/api.rb', line 13

def initialize(key)
	@key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



11
12
13
# File 'lib/email_hunter/api.rb', line 11

def key
  @key
end

Instance Method Details

#count(domain) ⇒ Object



37
38
39
# File 'lib/email_hunter/api.rb', line 37

def count(domain)
  EmailHunter::Count.new(domain).hunt
end

#exist(email) ⇒ Object

Email exist API



23
24
25
# File 'lib/email_hunter/api.rb', line 23

def exist(email)
  EmailHunter::Exist.new(email, self.key).hunt
end

#generate(domain, first_name, last_name) ⇒ Object

Email Generate API



33
34
35
# File 'lib/email_hunter/api.rb', line 33

def generate(domain, first_name, last_name)
  EmailHunter::Generate.new(domain, first_name, last_name, self.key).hunt
end

#search(domain, params = {}) ⇒ Object

Domain search API



18
19
20
# File 'lib/email_hunter/api.rb', line 18

def search(domain, params = {})
  EmailHunter::Search.new(domain, self.key, params).hunt
end

#verify(email) ⇒ Object

Email verify API



28
29
30
# File 'lib/email_hunter/api.rb', line 28

def verify(email)
  EmailHunter::Verify.new(email, self.key).hunt
end