Class: EmailHunter::Search

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, key, params = {}) ⇒ Search

Returns a new instance of Search.



10
11
12
13
14
# File 'lib/email_hunter/search.rb', line 10

def initialize(domain, key, params = {})
  @domain = domain
  @key = key
  @params = params
end

Instance Attribute Details

#emailsObject (readonly)

Returns the value of attribute emails.



8
9
10
# File 'lib/email_hunter/search.rb', line 8

def emails
  @emails
end

#offsetObject (readonly)

Returns the value of attribute offset.



8
9
10
# File 'lib/email_hunter/search.rb', line 8

def offset
  @offset
end

#resultsObject (readonly)

Returns the value of attribute results.



8
9
10
# File 'lib/email_hunter/search.rb', line 8

def results
  @results
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/email_hunter/search.rb', line 8

def status
  @status
end

#webmailObject (readonly)

Returns the value of attribute webmail.



8
9
10
# File 'lib/email_hunter/search.rb', line 8

def webmail
  @webmail
end

Instance Method Details

#huntObject



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

def hunt
  response = apiresponse
  Struct.new(*response.keys).new(*response.values) unless response.empty?
end