Sha256: 0204ac5aa5ff3dcdbf26df339987cadf66034fd4c58beb8e3f2e811c391fd629

Contents?: true

Size: 540 Bytes

Versions: 6

Compression:

Stored size: 540 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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
httpx-0.1.0 lib/httpx/buffer.rb
httpx-0.0.5 lib/httpx/buffer.rb
httpx-0.0.4 lib/httpx/buffer.rb
httpx-0.0.3 lib/httpx/buffer.rb
httpx-0.0.2 lib/httpx/buffer.rb
httpx-0.0.1 lib/httpx/buffer.rb