lib/httpx/buffer.rb in httpx-1.2.0 vs lib/httpx/buffer.rb in httpx-1.2.1
- old
+ new
@@ -1,9 +1,17 @@
# frozen_string_literal: true
require "forwardable"
module HTTPX
+ # Internal class to abstract a string buffer, by wrapping a string and providing the
+ # minimum possible API and functionality required.
+ #
+ # buffer = Buffer.new(640)
+ # buffer.full? #=> false
+ # buffer << "aa"
+ # buffer.capacity #=> 638
+ #
class Buffer
extend Forwardable
def_delegator :@buffer, :<<