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
1074
1075
1076
|
# File 'lib/carddb/collection.rb', line 1074
def best_match
@best_match ||= data['bestMatch'] ? ScanBestMatch.new(data['bestMatch'], client: client) : nil
end
|
#cancelled? ⇒ Boolean
1072
|
# File 'lib/carddb/collection.rb', line 1072
def cancelled? = status.to_s.downcase == 'cancelled'
|
#candidates ⇒ Object
1078
1079
1080
|
# File 'lib/carddb/collection.rb', line 1078
def candidates
@candidates ||= (data['candidates'] || []).map { |candidate| ScanCandidate.new(candidate, client: client) }
end
|
#client_request_id ⇒ Object
1062
|
# File 'lib/carddb/collection.rb', line 1062
def client_request_id = data['clientRequestId']
|
#completed? ⇒ Boolean
1070
|
# File 'lib/carddb/collection.rb', line 1070
def completed? = status.to_s.downcase == 'completed'
|
#completed_at ⇒ Object
1069
|
# File 'lib/carddb/collection.rb', line 1069
def completed_at = parse_time(data['completedAt'])
|
#created_at ⇒ Object
1066
|
# File 'lib/carddb/collection.rb', line 1066
def created_at = parse_time(data['createdAt'])
|
#dataset_key ⇒ Object
1060
|
# File 'lib/carddb/collection.rb', line 1060
def dataset_key = data['datasetKey']
|
#error ⇒ Object
1090
1091
1092
|
# File 'lib/carddb/collection.rb', line 1090
def error
@error ||= data['error'] ? ScanJobError.new(data['error'], client: client) : nil
end
|
1065
|
# File 'lib/carddb/collection.rb', line 1065
def = data['extracted'] || {}
|
#failed? ⇒ Boolean
1071
|
# File 'lib/carddb/collection.rb', line 1071
def failed? = status.to_s.downcase == 'failed'
|
#file_id ⇒ Object
1061
|
# File 'lib/carddb/collection.rb', line 1061
def file_id = data['fileId']
|
#game_key ⇒ Object
1059
|
# File 'lib/carddb/collection.rb', line 1059
def game_key = data['gameKey']
|
#job_id ⇒ Object
1056
|
# File 'lib/carddb/collection.rb', line 1056
def job_id = data['jobId']
|
#metrics ⇒ Object
1082
1083
1084
|
# File 'lib/carddb/collection.rb', line 1082
def metrics
@metrics ||= data['metrics'] ? ScanJobMetrics.new(data['metrics'], client: client) : nil
end
|
#publisher_slug ⇒ Object
1058
|
# File 'lib/carddb/collection.rb', line 1058
def publisher_slug = data['publisherSlug']
|
#started_at ⇒ Object
1068
|
# File 'lib/carddb/collection.rb', line 1068
def started_at = parse_time(data['startedAt'])
|
#status ⇒ Object
1057
|
# File 'lib/carddb/collection.rb', line 1057
def status = data['status']
|
#template_id ⇒ Object
1063
|
# File 'lib/carddb/collection.rb', line 1063
def template_id = data['templateId']
|
#template_version_id ⇒ Object
1064
|
# File 'lib/carddb/collection.rb', line 1064
def template_version_id = data['templateVersionId']
|
#updated_at ⇒ Object
1067
|
# File 'lib/carddb/collection.rb', line 1067
def updated_at = parse_time(data['updatedAt'])
|
#webhook ⇒ Object
1086
1087
1088
|
# File 'lib/carddb/collection.rb', line 1086
def webhook
@webhook ||= data['webhook'] ? ScanWebhookState.new(data['webhook'], client: client) : nil
end
|