Class: EmailHunter::Search
- Inherits:
-
Object
- Object
- EmailHunter::Search
- Defined in:
- lib/email_hunter/search.rb
Constant Summary collapse
- API_URL =
'https://api.hunter.io/v2/domain-search'
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #hunt ⇒ Object
-
#initialize(domain, key, params = {}) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(domain, key, params = {}) ⇒ Search
Returns a new instance of Search.
12 13 14 15 16 |
# File 'lib/email_hunter/search.rb', line 12 def initialize(domain, key, params = {}) @domain = domain @key = key @params = params end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
10 11 12 |
# File 'lib/email_hunter/search.rb', line 10 def domain @domain end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
10 11 12 |
# File 'lib/email_hunter/search.rb', line 10 def key @key end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/email_hunter/search.rb', line 10 def params @params end |
Instance Method Details
#hunt ⇒ Object
18 19 20 21 22 23 |
# File 'lib/email_hunter/search.rb', line 18 def hunt response_data = fetch_search_data return nil if response_data.empty? Struct.new(*response_data.keys).new(*response_data.values) end |