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.



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

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

Instance Method Details

#closeObject



291
292
293
# File 'lib/tus/storage/s3.rb', line 291

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

#eachObject



283
284
285
286
287
288
289
# File 'lib/tus/storage/s3.rb', line 283

def each
  return enum_for(__method__) unless block_given?

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

#lengthObject



279
280
281
# File 'lib/tus/storage/s3.rb', line 279

def length
  @length
end