Module: Zerobounce
- Defined in:
- lib/zerobounce.rb,
lib/zerobounce/error.rb,
lib/zerobounce/request.rb,
lib/zerobounce/version.rb,
lib/zerobounce/response.rb,
lib/zerobounce/configuration.rb,
lib/zerobounce/request/v1_request.rb,
lib/zerobounce/request/v2_request.rb,
lib/zerobounce/response/v1_response.rb,
lib/zerobounce/response/v2_response.rb,
lib/zerobounce/middleware/raise_http_exception.rb
Overview
Validate an email address with Zerobounce.net
Defined Under Namespace
Modules: Middleware Classes: ApiError, Configuration, Error, InternalServerError, MissingParameter, Request, Response, UnknownError
Constant Summary collapse
- VERSION =
The version of the gem.
'0.3.1'
Class Attribute Summary collapse
-
.configuration ⇒ Zerobounce::Configuration
(also: config)
Zerobounce configuration.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Configure Zerobounce inside a block.
-
.credits(params = {}) ⇒ Integer
Get the number of remaining credits on the account.
-
.invalid?(email, params = {}) ⇒ Boolean
Convenience method for checking if an email address is invalid.
-
.valid?(email, params = {}) ⇒ Boolean
Convenience method for checking if an email address is valid.
-
.validate(params) ⇒ Zerobounce::Response
Validates the email address and gets geoip information for an IP if provided.
Class Attribute Details
.configuration ⇒ Zerobounce::Configuration Also known as: config
Zerobounce configuration
18 19 20 |
# File 'lib/zerobounce.rb', line 18 def configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|config| ... } ⇒ Object
Configure Zerobounce inside a block.
31 32 33 |
# File 'lib/zerobounce.rb', line 31 def configure yield configuration end |
.credits(params = {}) ⇒ Integer
Get the number of remaining credits on the account.
57 58 59 |
# File 'lib/zerobounce.rb', line 57 def credits(params={}) Request.new(params).credits(params) end |
.invalid?(email, params = {}) ⇒ Boolean
Convenience method for checking if an email address is invalid.
75 76 77 |
# File 'lib/zerobounce.rb', line 75 def invalid?(email, params={}) validate(params.merge(email: email)).invalid? end |
.valid?(email, params = {}) ⇒ Boolean
Convenience method for checking if an email address is valid.
66 67 68 |
# File 'lib/zerobounce.rb', line 66 def valid?(email, params={}) validate(params.merge(email: email)).valid? end |
.validate(params) ⇒ Zerobounce::Response
Validates the email address and gets geoip information for an IP if provided.
45 46 47 |
# File 'lib/zerobounce.rb', line 45 def validate(params) Request.new(params).validate(params) end |