Class: CardDB::GameImportJob

Inherits:
Resource 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

#account_idObject



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

def  = data['accountId']

#assetsObject



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

def assets
  @assets ||= (data['assets'] || []).map { |asset| ImportJobAsset.new(asset, client: client) }
end

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

def completed_at = parse_time(data['completedAt'])

#completed_dataset_keysObject



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

def completed_dataset_keys = data['completedDatasetKeys'] || []

#completed_datasetsObject



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

def completed_datasets = data['completedDatasets']

#created_atObject



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

def created_at = parse_time(data['createdAt'])

#current_dataset_keyObject



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

def current_dataset_key = data['currentDatasetKey']

#dataset_statusesObject



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

def dataset_statuses
  @dataset_statuses ||= (data['datasetStatuses'] || []).map do |status|
    GameImportDatasetStatus.new(status, client: client)
  end
end

#error_messageObject



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

def error_message = data['errorMessage']

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#file_idObject



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

def file_id = data['fileId']

#gameObject



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

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

#game_idObject



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

def game_id = data['gameId']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#import_orderObject



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

def import_order = data['importOrder'] || []

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']


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

def link_building_completed_datasets = data['linkBuildingCompletedDatasets']


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

def link_building_dataset = data['linkBuildingDataset']


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

def link_building_processed_records = data['linkBuildingProcessedRecords']


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

def link_building_total_datasets = data['linkBuildingTotalDatasets']


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

def link_building_total_records = data['linkBuildingTotalRecords']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#phaseObject



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

def phase = data['phase']

#progressObject



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

def progress = data['progress']

#publisherObject



1253
1254
1255
# File 'lib/carddb/collection.rb', line 1253

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

def resumed? = !!data['isResumed']

#started_atObject



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

def started_at = parse_time(data['startedAt'])

#statusObject



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

def status = data['status']

#total_datasetsObject



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

def total_datasets = data['totalDatasets']

#updated_atObject



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

def updated_at = parse_time(data['updatedAt'])