Sha256: 9cf9a9cb80f3f03dbcf17c3a10c88b5ec3ab931bcb8af82821c9323228b21b08

Contents?: true

Size: 564 Bytes

Versions: 7

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module HTTPX
  class Buffer
    extend Forwardable

    def_delegator :@buffer, :<<

    def_delegator :@buffer, :to_s

    def_delegator :@buffer, :to_str

    def_delegator :@buffer, :empty?

    def_delegator :@buffer, :bytesize

    def_delegator :@buffer, :slice!

    def_delegator :@buffer, :clear

    def_delegator :@buffer, :replace

    attr_reader :limit

    def initialize(limit)
      @buffer = "".b
      @limit = limit
    end

    def full?
      @buffer.bytesize >= @limit
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
httpx-0.5.0 lib/httpx/buffer.rb
httpx-0.4.1 lib/httpx/buffer.rb
httpx-0.4.0 lib/httpx/buffer.rb
httpx-0.3.1 lib/httpx/buffer.rb
httpx-0.3.0 lib/httpx/buffer.rb
httpx-0.2.1 lib/httpx/buffer.rb
httpx-0.2.0 lib/httpx/buffer.rb