Class: OpenURI::Buffer

Inherits:
Object show all
Defined in:
opal/stdlib/open-uri.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuffer

Returns a new instance of Buffer.



183
184
185
186
# File 'opal/stdlib/open-uri.rb', line 183

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

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



187
188
189
# File 'opal/stdlib/open-uri.rb', line 187

def size
  @size
end

Instance Method Details

#<<(str) ⇒ Object



189
190
191
192
# File 'opal/stdlib/open-uri.rb', line 189

def <<(str)
  @io << str
  @size += str.length
end

#ioObject



194
195
196
197
# File 'opal/stdlib/open-uri.rb', line 194

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