Sha256: b5d8a788259802e5b1b590a0d5431910bf8bd242d600d505af73b088d5e05a5e

Contents?: true

Size: 766 Bytes

Versions: 6

Compression:

Stored size: 766 Bytes

Contents

module AddressFinder
  class Bulk
    def initialize(&block)
      @block = block
    end

    def perform
      Net::HTTP.start(config.hostname, config.port, use_ssl: true,
                                                    open_timeout: config.timeout,
                                                    read_timeout: config.timeout) do |http|
        block.call ClientProxy.new(http: http)
      end
    end

    private

    attr_reader :block

    def config
      @_config ||= AddressFinder.configuration
    end

    class ClientProxy
      def initialize(http:)
        @http = http
      end

      def cleanse(args={})
        AddressFinder::Cleanse.new(args.merge(http: http)).perform
      end

      private

      attr_reader :http
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
addressfinder-1.5.0 lib/addressfinder/bulk.rb
addressfinder-1.4.0 lib/addressfinder/bulk.rb
addressfinder-1.3.0 lib/addressfinder/bulk.rb
addressfinder-1.2.0 lib/addressfinder/bulk.rb
addressfinder-1.1.2 lib/addressfinder/bulk.rb
addressfinder-1.1.1 lib/addressfinder/bulk.rb