Method: Down::ChunkedIO#initialize

Defined in:
lib/down/chunked_io.rb

#initialize(options) ⇒ ChunkedIO

Returns a new instance of ChunkedIO.



7
8
9
10
11
12
13
14
15
# File 'lib/down/chunked_io.rb', line 7

def initialize(options)
  @size     = options.fetch(:size)
  @chunks   = options.fetch(:chunks)
  @on_close = options.fetch(:on_close, ->{})
  @data     = options.fetch(:data, {})
  @tempfile = Tempfile.new("down", binmode: true)

  peek_chunk
end