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