Sha256: cab4aea0b9edf47624adafb15bb3e576b07083a4f7d24066d91ed58a74ef32ac

Contents?: true

Size: 476 Bytes

Versions: 61

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

require_relative "session"
module HTTPX
  class Session
    def initialize(options = EMPTY_HASH, &blk)
      @options = self.class.default_options.merge(options)
      @responses = {}
      @persistent = @options.persistent
      wrap(&blk) if blk
    end

    def wrap
      begin
        prev_persistent = @persistent
        @persistent = true
        yield self
      ensure
        @persistent = prev_persistent
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
httpx-1.3.1 lib/httpx/session2.rb
httpx-1.3.0 lib/httpx/session2.rb
httpx-1.2.6 lib/httpx/session2.rb
httpx-1.2.4 lib/httpx/session2.rb
httpx-1.2.3 lib/httpx/session2.rb
httpx-1.2.2 lib/httpx/session2.rb
httpx-1.2.1 lib/httpx/session2.rb
httpx-1.2.0 lib/httpx/session2.rb
httpx-1.1.5 lib/httpx/session2.rb
httpx-1.1.4 lib/httpx/session2.rb
httpx-1.1.3 lib/httpx/session2.rb
httpx-1.1.2 lib/httpx/session2.rb
httpx-1.1.1 lib/httpx/session2.rb
httpx-1.1.0 lib/httpx/session2.rb
httpx-1.0.2 lib/httpx/session2.rb
httpx-0.24.7 lib/httpx/session2.rb
httpx-1.0.1 lib/httpx/session2.rb
httpx-1.0.0 lib/httpx/session2.rb
httpx-0.24.6 lib/httpx/session2.rb
httpx-0.24.5 lib/httpx/session2.rb