Class: Hunter::Api

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ Api

Returns a new instance of Api.



14
15
16
# File 'lib/hunter/api.rb', line 14

def initialize(key)
	@key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



12
13
14
# File 'lib/hunter/api.rb', line 12

def key
  @key
end

Instance Method Details

#domain_search(domain, options = nil) ⇒ Object



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

def domain_search(domain, options = nil)
  Hunter::DomainSearch.new(domain, self.key).perform(options)
end

#email_count(domain) ⇒ Object



22
23
24
# File 'lib/hunter/api.rb', line 22

def email_count(domain)
  Hunter::EmailCount.new(domain).perform
end

#email_finder(first_name, last_name, options) ⇒ Object



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

def email_finder(first_name, last_name, options)
  Hunter::EmailFinder.new(first_name, last_name, self.key).perform(options.reject {| key, value | value.nil? })
end

#email_verifier(email) ⇒ Object



30
31
32
# File 'lib/hunter/api.rb', line 30

def email_verifier(email)
  Hunter::EmailVerifier.new(email, self.key).perform
end