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



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

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

#errorsObject



1266
1267
1268
# File 'lib/carddb/collection.rb', line 1266

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

#insertedObject



1256
1257
1258
# File 'lib/carddb/collection.rb', line 1256

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

#skippedObject



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

def skipped = data['skipped']

#statsObject



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

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

#updatedObject



1260
1261
1262
# File 'lib/carddb/collection.rb', line 1260

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