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



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

def  = data['accountId']

#assetsObject



1535
1536
1537
# File 'lib/carddb/collection.rb', line 1535

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

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

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

#completed_dataset_keysObject



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

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

#completed_datasetsObject



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

def completed_datasets = data['completedDatasets']

#created_atObject



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

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

#current_dataset_keyObject



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

def current_dataset_key = data['currentDatasetKey']

#dataset_statusesObject



1539
1540
1541
1542
1543
# File 'lib/carddb/collection.rb', line 1539

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

#error_messageObject



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

def error_message = data['errorMessage']

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#file_idObject



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

def file_id = data['fileId']

#gameObject



1531
1532
1533
# File 'lib/carddb/collection.rb', line 1531

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

#game_idObject



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

def game_id = data['gameId']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#import_orderObject



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

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

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']


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

def link_building_completed_datasets = data['linkBuildingCompletedDatasets']


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

def link_building_dataset = data['linkBuildingDataset']


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

def link_building_processed_records = data['linkBuildingProcessedRecords']


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

def link_building_total_datasets = data['linkBuildingTotalDatasets']


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

def link_building_total_records = data['linkBuildingTotalRecords']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#phaseObject



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

def phase = data['phase']

#progressObject



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

def progress = data['progress']

#publisherObject



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

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

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

#started_atObject



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

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

#statusObject



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

def status = data['status']

#total_datasetsObject



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

def total_datasets = data['totalDatasets']

#updated_atObject



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

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