Sha256: 1608e80866475e5eb52ad33c581ca485bae441d23381657fdd87ae67524667ad

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

# frozen_string_literal: true

require 'zerobounce/error'
require 'zerobounce/version'
require 'zerobounce/request'
require 'zerobounce/response'
require 'zerobounce/configuration'

# Validate an email address with Zerobounce.net
module Zerobounce
  class << self
    attr_writer :configuration

    # Zerobounce configuration
    #
    # @return [Zerobounce::Configuration]
    def configuration
      @configuration ||= Configuration.new
    end
    alias config configuration

    # Configure Zerobounce inside a block.
    #
    # @example
    #   Zerobounce.configure do |config|
    #     config.api_key = 'api-key'
    #   end
    #
    # @yieldparam [Zerobounce::Configuration] config
    def configure
      yield configuration
    end

    # Validate an email address and/or IP address.
    #
    # @param [Hash] params
    # @return [Zerobounce::Response]
    def validate(params)
      Request.new(params).get(params)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zerobounce-0.0.1 lib/zerobounce.rb