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



1009
1010
1011
# File 'lib/carddb/collection.rb', line 1009

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

#errorsObject



1005
1006
1007
# File 'lib/carddb/collection.rb', line 1005

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

#insertedObject



995
996
997
# File 'lib/carddb/collection.rb', line 995

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

#skippedObject



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

def skipped = data['skipped']

#statsObject



1013
1014
1015
# File 'lib/carddb/collection.rb', line 1013

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

#updatedObject



999
1000
1001
# File 'lib/carddb/collection.rb', line 999

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