Class: CardDB::BulkImportResult

Inherits:
Resource
  • Object
show all
Defined in:
lib/carddb/collection.rb

Instance Attribute Summary

Attributes inherited from Resource

#client, #data

Instance Method Summary collapse

Methods inherited from Resource

#[], #initialize, #key?, #to_h, #to_json

Constructor Details

This class inherits a constructor from CardDB::Resource

Instance Method Details

#created_fieldsObject



1283
1284
1285
# File 'lib/carddb/collection.rb', line 1283

def created_fields
  @created_fields ||= (data['createdFields'] || []).map { |field| ObjectField.new(field, client: client) }
end

#errorsObject



1279
1280
1281
# File 'lib/carddb/collection.rb', line 1279

def errors
  @errors ||= (data['errors'] || []).map { |error| BulkRecordError.new(error, client: client) }
end

#insertedObject



1269
1270
1271
# File 'lib/carddb/collection.rb', line 1269

def inserted
  @inserted ||= (data['inserted'] || []).map { |record| Record.new(record, client: client) }
end

#skippedObject



1277
# File 'lib/carddb/collection.rb', line 1277

def skipped = data['skipped']

#statsObject



1287
1288
1289
# File 'lib/carddb/collection.rb', line 1287

def stats
  @stats ||= data['stats'] ? ImportStats.new(data['stats'], client: client) : nil
end

#updatedObject



1273
1274
1275
# File 'lib/carddb/collection.rb', line 1273

def updated
  @updated ||= (data['updated'] || []).map { |record| Record.new(record, client: client) }
end