Class: HTTPX::Buffer

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/httpx/buffer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit) ⇒ Buffer

Returns a new instance of Buffer.



27
28
29
30
# File 'lib/httpx/buffer.rb', line 27

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

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



25
26
27
# File 'lib/httpx/buffer.rb', line 25

def limit
  @limit
end

Instance Method Details

#full?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/httpx/buffer.rb', line 32

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