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/middleware/raise_error.rb
Overview
Validate an email address with Zerobounce.net
Defined Under Namespace
Modules: Middleware Classes: ApiError, Configuration, Error, InternalServerError, MissingParameter, Request, Response
Constant Summary collapse
- VERSION =
The version of the gem.
'0.0.3'
Class Attribute Summary collapse
-
.configuration ⇒ Zerobounce::Configuration
(also: config)
Zerobounce configuration.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Configure Zerobounce inside a block.
-
.valid?(email) ⇒ Boolean
Convenience method for checking if an email address is valid.
-
.validate(params) ⇒ Zerobounce::Response
Validate an email address and/or IP address.
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 |
.valid?(email) ⇒ Boolean
Convenience method for checking if an email address is valid.
47 48 49 |
# File 'lib/zerobounce.rb', line 47 def valid?(email) validate(email: email).valid? end |
.validate(params) ⇒ Zerobounce::Response
Validate an email address and/or IP address.
39 40 41 |
# File 'lib/zerobounce.rb', line 39 def validate(params) Request.new(params).get(params) end |