class DropboxApi::Metadata::ThumbnailBatchResultEntry
This class is used as an adapter so we can create an object of the pertinent class when we need to infer the type from the data.
This same pattern is used in `DropboxApi::Metadata::Resource`
So this could initalize an object of either `ThumbnailBatchResultData` or `ThumbnailError`.
Public Class Methods
new(data)
click to toggle source
# File lib/dropbox_api/metadata/thumbnail_batch_result_entry.rb, line 12 def new(data) case data['.tag'].to_sym when :success DropboxApi::Metadata::ThumbnailBatchResultData.new(data) when :failure DropboxApi::Errors::ThumbnailError.build('Thumbnail generation failed', data['failure']) else raise NotImplementedError, "Unknown result type: #{data[".tag"]}" end end