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-0.24.4 lib/httpx/session2.rb
httpx-0.24.3 lib/httpx/session2.rb
httpx-0.24.2 lib/httpx/session2.rb
httpx-0.24.1 lib/httpx/session2.rb
httpx-0.24.0 lib/httpx/session2.rb
httpx-0.23.4 lib/httpx/session2.rb
httpx-0.23.3 lib/httpx/session2.rb
httpx-0.23.2 lib/httpx/session2.rb
httpx-0.23.1 lib/httpx/session2.rb
httpx-0.23.0 lib/httpx/session2.rb
httpx-0.22.5 lib/httpx/session2.rb
httpx-0.22.4 lib/httpx/session2.rb
httpx-0.22.3 lib/httpx/session2.rb
httpx-0.22.2 lib/httpx/session2.rb
httpx-0.22.1 lib/httpx/session2.rb
httpx-0.22.0 lib/httpx/session2.rb
httpx-0.21.1 lib/httpx/session2.rb
httpx-0.21.0 lib/httpx/session2.rb
httpx-0.20.5 lib/httpx/session2.rb
httpx-0.20.4 lib/httpx/session2.rb