module Zerobounce
Validate an email address with Zerobounce.net
Constants
- VERSION
The version of the gem.
Attributes
Public Class Methods
Zerobounce
configuration
@return [Zerobounce::Configuration]
# File lib/zerobounce.rb, line 18 def configuration @configuration ||= Configuration.new end
Configure Zerobounce
inside a block.
@example
Zerobounce.configure do |config| config.apikey = 'api-key' end
@yieldparam [Zerobounce::Configuration] config
# File lib/zerobounce.rb, line 31 def configure yield configuration end
Get the number of remaining credits on the account.
@param [Hash] params @option params [String] :apikey Use a different API key for this request. @option params [String] :host Use a different host for this request. @option params [String] :headers Use different headers for this request. @option params [Proc] :middleware Use different middleware for this request. @return [Integer]
# File lib/zerobounce.rb, line 57 def credits(params={}) Request.new(params).credits(params) end
Convenience method for checking if an email address is invalid.
@param [String] email @param [Hash] params @return [Boolean]
# File lib/zerobounce.rb, line 75 def invalid?(email, params={}) validate(params.merge(email: email)).invalid? end
Convenience method for checking if an email address is valid.
@param [String] email @param [Hash] params @return [Boolean]
# File lib/zerobounce.rb, line 66 def valid?(email, params={}) validate(params.merge(email: email)).valid? end
Validates the email address and gets geoip information for an IP if provided.
@param [Hash] params @option params [String] :email The email address to validate. @option params [String] :ip_address An IP address, :ipaddress also works. @option params [String] :apikey Use a different API key for this request. @option params [String] :host Use a different host for this request. @option params [String] :headers Use different headers for this request. @option params [Proc] :middleware Use different middleware for this request. @return [Zerobounce::Response]
# File lib/zerobounce.rb, line 45 def validate(params) Request.new(params).validate(params) end