123456789_123456789_123456789_123456789_123456789_

Class: OpenURI::Buffer

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/open-uri.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newBuffer

[ GitHub ]

  
# File 'lib/open-uri.rb', line 400

def initialize
  @io = StringIO.new
  @size = 0
end

Instance Attribute Details

#size (readonly)

[ GitHub ]

  
# File 'lib/open-uri.rb', line 404

attr_reader :size

Instance Method Details

#<<(str)

[ GitHub ]

  
# File 'lib/open-uri.rb', line 407

def <<(str)
  @io << str
  @size += str.length
  if StringIO === @io && StringMax < @size
    require 'tempfile'
    io = Tempfile.new('open-uri')
    io.binmode
    Meta.init io, @io if Meta === @io
    io << @io.string
    @io = io
  end
end

#io

[ GitHub ]

  
# File 'lib/open-uri.rb', line 420

def io
  Meta.init @io unless Meta === @io
  @io
end