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



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

def  = data['accountId']

#assetsObject



1522
1523
1524
# File 'lib/carddb/collection.rb', line 1522

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

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

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

#completed_dataset_keysObject



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

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

#completed_datasetsObject



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

def completed_datasets = data['completedDatasets']

#created_atObject



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

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

#current_dataset_keyObject



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

def current_dataset_key = data['currentDatasetKey']

#dataset_statusesObject



1526
1527
1528
1529
1530
# File 'lib/carddb/collection.rb', line 1526

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

#error_messageObject



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

def error_message = data['errorMessage']

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#file_idObject



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

def file_id = data['fileId']

#gameObject



1518
1519
1520
# File 'lib/carddb/collection.rb', line 1518

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

#game_idObject



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

def game_id = data['gameId']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#import_orderObject



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

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

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']


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

def link_building_completed_datasets = data['linkBuildingCompletedDatasets']


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

def link_building_dataset = data['linkBuildingDataset']


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

def link_building_processed_records = data['linkBuildingProcessedRecords']


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

def link_building_total_datasets = data['linkBuildingTotalDatasets']


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

def link_building_total_records = data['linkBuildingTotalRecords']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#phaseObject



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

def phase = data['phase']

#progressObject



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

def progress = data['progress']

#publisherObject



1514
1515
1516
# File 'lib/carddb/collection.rb', line 1514

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

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

#started_atObject



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

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

#statusObject



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

def status = data['status']

#total_datasetsObject



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

def total_datasets = data['totalDatasets']

#updated_atObject



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

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