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