Class: Puma::IOBuffer
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: 
          self,
          StringIO
         | |
| Instance Chain: 
          self,
          StringIO
         | |
| Inherits: | StringIO 
 | 
| Defined in: | lib/puma/io_buffer.rb | 
Class Method Summary
- .new ⇒ IOBuffer constructor
Instance Attribute Summary
- #empty? ⇒ Boolean readonly
Instance Method Summary
- 
    
      #append(*strs)  
    
    truffleruby (24.2.1, like ruby 3.3.7). 
- 
    
      #clear  
    
    Alias for #reset. 
- 
    
      #read_and_reset  ⇒ String 
    
    Read & Reset - returns contents and resets. 
- #reset (also: #clear)
- #to_s
Constructor Details
    .new  ⇒ IOBuffer 
  
# File 'lib/puma/io_buffer.rb', line 7
def initialize super.binmode end
Instance Attribute Details
    #empty?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
# File 'lib/puma/io_buffer.rb', line 11
def empty? length.zero? end
Instance Method Details
#append(*strs)
truffleruby (24.2.1, like ruby 3.3.7)
StringIO.new.write("a", "b") # => `write': wrong number of arguments (given 2, expected 1) (ArgumentError)# File 'lib/puma/io_buffer.rb', line 41
def append(*strs) strs.each { |str| write str } end
#clear
Alias for #reset.
# File 'lib/puma/io_buffer.rb', line 35
alias_method :clear, :reset
    #read_and_reset  ⇒ String 
  
Read & Reset - returns contents and resets
# File 'lib/puma/io_buffer.rb', line 27
def read_and_reset rewind str = read truncate 0 rewind str end
#reset Also known as: #clear
[ GitHub ]# File 'lib/puma/io_buffer.rb', line 15
def reset truncate 0 rewind end
#to_s
[ GitHub ]# File 'lib/puma/io_buffer.rb', line 20
def to_s rewind read end