Sha256: cdbe101ad24a98e2c8b40318a2ca2249e27f922e454d3af71783c8707b7e6e30

Contents?: true

Size: 887 Bytes

Versions: 8

Compression:

Stored size: 887 Bytes

Contents

# frozen_string_literal: true

require 'rest-client'

module Zerobounce
  # Configuration object for Zerobounce.
  #
  # @author Aaron Frase
  #
  # @attr [String] host
  #   The Zerobounce API host.
  #
  # @attr [Hash] headers
  #   Headers to use in all requests.
  #
  # @attr [String] apikey
  #   A Zerobounce API key.
  #
  # @attr [Array<Symbol>] valid_statues
  #   The statuses that are considered valid by {Response#valid?}.
  class Configuration
    attr_accessor :host
    attr_accessor :headers
    attr_accessor :apikey
    attr_accessor :valid_statuses
    attr_accessor :mock

    def initialize(mock=false)
      self.host = 'https://api.zerobounce.net'
      self.apikey = ENV['ZEROBOUNCE_API_KEY']
      self.valid_statuses = %i[valid catch_all]
      self.headers = { user_agent: "ZerobounceRubyGem/#{Zerobounce::VERSION}" }
      self.mock = mock
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
zerobounceindia-sdk-1.1.0 lib/zerobounce/configuration.rb
zerobounce-sdk-1.1.0 lib/zerobounce/configuration.rb
zerobounce-sdk-1.0.1 lib/zerobounce/configuration.rb
zerobounceindia-sdk-1.0.1 lib/zerobounce/configuration.rb
zerobounceindia-sdk-1.0.0 lib/zerobounce/configuration.rb
zerobounce-sdk-1.0.0 lib/zerobounce/configuration.rb
zerobounceindia-sdk-0.4.0 lib/zerobounce/configuration.rb
zerobounce-sdk-0.4.0 lib/zerobounce/configuration.rb