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



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

def  = data['accountId']

#assetsObject



1585
1586
1587
# File 'lib/carddb/collection.rb', line 1585

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

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

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

#completed_dataset_keysObject



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

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

#completed_datasetsObject



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

def completed_datasets = data['completedDatasets']

#created_atObject



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

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

#current_dataset_keyObject



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

def current_dataset_key = data['currentDatasetKey']

#dataset_statusesObject



1589
1590
1591
1592
1593
# File 'lib/carddb/collection.rb', line 1589

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

#error_messageObject



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

def error_message = data['errorMessage']

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#file_idObject



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

def file_id = data['fileId']

#gameObject



1581
1582
1583
# File 'lib/carddb/collection.rb', line 1581

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

#game_idObject



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

def game_id = data['gameId']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#import_orderObject



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

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

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']


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

def link_building_completed_datasets = data['linkBuildingCompletedDatasets']


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

def link_building_dataset = data['linkBuildingDataset']


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

def link_building_processed_records = data['linkBuildingProcessedRecords']


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

def link_building_total_datasets = data['linkBuildingTotalDatasets']


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

def link_building_total_records = data['linkBuildingTotalRecords']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#phaseObject



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

def phase = data['phase']

#progressObject



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

def progress = data['progress']

#publisherObject



1577
1578
1579
# File 'lib/carddb/collection.rb', line 1577

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

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

#started_atObject



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

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

#statusObject



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

def status = data['status']

#total_datasetsObject



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

def total_datasets = data['totalDatasets']

#updated_atObject



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

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