Class: Uploadcare::Collections::BatchResult
- Inherits:
-
Object
- Object
- Uploadcare::Collections::BatchResult
- Defined in:
- lib/uploadcare/collections/batch_result.rb
Overview
Result object for batch file operations (store/delete).
Wraps the response from batch operations and provides access to:
- Successfully processed files
- Files that encountered problems
- Overall operation status
Instance Attribute Summary collapse
-
#problems ⇒ Hash
readonly
Hash mapping UUIDs to error messages.
-
#result ⇒ Array<Uploadcare::Resources::File>
readonly
Successfully processed File objects.
-
#status ⇒ Integer?
readonly
HTTP status code of the operation.
Instance Method Summary collapse
-
#initialize(status:, result:, problems:, client:) ⇒ BatchResult
constructor
Initialize a new BatchResult.
Constructor Details
#initialize(status:, result:, problems:, client:) ⇒ BatchResult
Initialize a new BatchResult.
30 31 32 33 34 |
# File 'lib/uploadcare/collections/batch_result.rb', line 30 def initialize(status:, result:, problems:, client:) @status = status @result = result ? result.map { |file_data| Uploadcare::Resources::File.new(file_data, client) } : [] @problems = problems || {} end |
Instance Attribute Details
#problems ⇒ Hash (readonly)
Returns Hash mapping UUIDs to error messages.
22 23 24 |
# File 'lib/uploadcare/collections/batch_result.rb', line 22 def problems @problems end |
#result ⇒ Array<Uploadcare::Resources::File> (readonly)
Returns Successfully processed File objects.
19 20 21 |
# File 'lib/uploadcare/collections/batch_result.rb', line 19 def result @result end |
#status ⇒ Integer? (readonly)
Returns HTTP status code of the operation.
16 17 18 |
# File 'lib/uploadcare/collections/batch_result.rb', line 16 def status @status end |