Class: CardDB::ScanJob
Instance Attribute Summary
Attributes inherited from Resource
#client, #data
Instance Method Summary
collapse
Methods inherited from Resource
#[], #initialize, #key?, #to_h, #to_json
Instance Method Details
#best_match ⇒ Object
1024
1025
1026
|
# File 'lib/carddb/collection.rb', line 1024
def best_match
@best_match ||= data['bestMatch'] ? ScanBestMatch.new(data['bestMatch'], client: client) : nil
end
|
#cancelled? ⇒ Boolean
1022
|
# File 'lib/carddb/collection.rb', line 1022
def cancelled? = status.to_s.downcase == 'cancelled'
|
#candidates ⇒ Object
1028
1029
1030
|
# File 'lib/carddb/collection.rb', line 1028
def candidates
@candidates ||= (data['candidates'] || []).map { |candidate| ScanCandidate.new(candidate, client: client) }
end
|
#client_request_id ⇒ Object
1012
|
# File 'lib/carddb/collection.rb', line 1012
def client_request_id = data['clientRequestId']
|
#completed? ⇒ Boolean
1020
|
# File 'lib/carddb/collection.rb', line 1020
def completed? = status.to_s.downcase == 'completed'
|
#completed_at ⇒ Object
1019
|
# File 'lib/carddb/collection.rb', line 1019
def completed_at = parse_time(data['completedAt'])
|
#created_at ⇒ Object
1016
|
# File 'lib/carddb/collection.rb', line 1016
def created_at = parse_time(data['createdAt'])
|
#dataset_key ⇒ Object
1010
|
# File 'lib/carddb/collection.rb', line 1010
def dataset_key = data['datasetKey']
|
#error ⇒ Object
1040
1041
1042
|
# File 'lib/carddb/collection.rb', line 1040
def error
@error ||= data['error'] ? ScanJobError.new(data['error'], client: client) : nil
end
|
1015
|
# File 'lib/carddb/collection.rb', line 1015
def = data['extracted'] || {}
|
#failed? ⇒ Boolean
1021
|
# File 'lib/carddb/collection.rb', line 1021
def failed? = status.to_s.downcase == 'failed'
|
#file_id ⇒ Object
1011
|
# File 'lib/carddb/collection.rb', line 1011
def file_id = data['fileId']
|
#game_key ⇒ Object
1009
|
# File 'lib/carddb/collection.rb', line 1009
def game_key = data['gameKey']
|
#job_id ⇒ Object
1006
|
# File 'lib/carddb/collection.rb', line 1006
def job_id = data['jobId']
|
#metrics ⇒ Object
1032
1033
1034
|
# File 'lib/carddb/collection.rb', line 1032
def metrics
@metrics ||= data['metrics'] ? ScanJobMetrics.new(data['metrics'], client: client) : nil
end
|
#publisher_slug ⇒ Object
1008
|
# File 'lib/carddb/collection.rb', line 1008
def publisher_slug = data['publisherSlug']
|
#started_at ⇒ Object
1018
|
# File 'lib/carddb/collection.rb', line 1018
def started_at = parse_time(data['startedAt'])
|
#status ⇒ Object
1007
|
# File 'lib/carddb/collection.rb', line 1007
def status = data['status']
|
#template_id ⇒ Object
1013
|
# File 'lib/carddb/collection.rb', line 1013
def template_id = data['templateId']
|
#template_version_id ⇒ Object
1014
|
# File 'lib/carddb/collection.rb', line 1014
def template_version_id = data['templateVersionId']
|
#updated_at ⇒ Object
1017
|
# File 'lib/carddb/collection.rb', line 1017
def updated_at = parse_time(data['updatedAt'])
|
#webhook ⇒ Object
1036
1037
1038
|
# File 'lib/carddb/collection.rb', line 1036
def webhook
@webhook ||= data['webhook'] ? ScanWebhookState.new(data['webhook'], client: client) : nil
end
|