Class: QuickEmailVerification::Api::Quickemailverification
- Inherits:
-
Object
- Object
- QuickEmailVerification::Api::Quickemailverification
- Defined in:
- lib/quickemailverification/api/quickemailverification.rb
Overview
QuickEmailVerification Class for email verification
Instance Method Summary collapse
-
#initialize(client) ⇒ Quickemailverification
constructor
A new instance of Quickemailverification.
-
#sandbox(email, options = {}) ⇒ Object
Return predefined response for predefined email address.
-
#verify(email, options = {}) ⇒ Object
Verify email address and get detailed response.
Constructor Details
#initialize(client) ⇒ Quickemailverification
Returns a new instance of Quickemailverification.
8 9 10 |
# File 'lib/quickemailverification/api/quickemailverification.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#sandbox(email, options = {}) ⇒ Object
Return predefined response for predefined email address
‘/verify/sandbox?email=:email’ GET
email - send email address in query parameter
30 31 32 33 34 35 36 |
# File 'lib/quickemailverification/api/quickemailverification.rb', line 30 def sandbox(email, = {}) body = .fetch("query", {}) email = CGI::escape(email) @client.get("/verify/sandbox?email=#{email}", body, ) end |
#verify(email, options = {}) ⇒ Object
Verify email address and get detailed response
‘/verify?email=:email’ GET
email - send email address in query parameter
17 18 19 20 21 22 23 |
# File 'lib/quickemailverification/api/quickemailverification.rb', line 17 def verify(email, = {}) body = .fetch("query", {}) email = CGI::escape(email) @client.get("/verify?email=#{email}", body, ) end |