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.



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

def initialize(key)
	@key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/email_hunter/api.rb', line 9

def key
  @key
end

Instance Method Details

#exist(email) ⇒ Object

Email exist API



21
22
23
# File 'lib/email_hunter/api.rb', line 21

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

#generate(domain, first_name, last_name) ⇒ Object

Email Generate API



31
32
33
# File 'lib/email_hunter/api.rb', line 31

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



16
17
18
# File 'lib/email_hunter/api.rb', line 16

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

#verify(email) ⇒ Object

Email verify API



26
27
28
# File 'lib/email_hunter/api.rb', line 26

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