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



1333
1334
1335
# File 'lib/carddb/collection.rb', line 1333

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

#errorsObject



1329
1330
1331
# File 'lib/carddb/collection.rb', line 1329

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

#insertedObject



1319
1320
1321
# File 'lib/carddb/collection.rb', line 1319

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

#skippedObject



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

def skipped = data['skipped']

#statsObject



1337
1338
1339
# File 'lib/carddb/collection.rb', line 1337

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

#updatedObject



1323
1324
1325
# File 'lib/carddb/collection.rb', line 1323

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