Class: Tus::Storage::S3::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tus/storage/s3.rb

Instance Method Summary collapse

Constructor Details

#initialize(chunks:, length:) ⇒ Response

Returns a new instance of Response.



268
269
270
271
# File 'lib/tus/storage/s3.rb', line 268

def initialize(chunks:, length:)
  @chunks = chunks
  @length = length
end

Instance Method Details

#closeObject



285
286
287
# File 'lib/tus/storage/s3.rb', line 285

def close
  chunks_fiber.resume(:close) if chunks_fiber.alive?
end

#eachObject



277
278
279
280
281
282
283
# File 'lib/tus/storage/s3.rb', line 277

def each
  return enum_for(__method__) unless block_given?

  while (chunk = chunks_fiber.resume)
    yield chunk
  end
end

#lengthObject



273
274
275
# File 'lib/tus/storage/s3.rb', line 273

def length
  @length
end