Class: EVSSClaimServiceAsync
- Inherits:
-
Object
- Object
- EVSSClaimServiceAsync
show all
- Includes:
- SentryLogging
- Defined in:
- app/services/evss_claim_service_async.rb
Instance Method Summary
collapse
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Constructor Details
Returns a new instance of EVSSClaimServiceAsync.
Instance Method Details
#all ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/services/evss_claim_service_async.rb', line 11
def all
status = @tracker.get_collection_status
unless status
status = 'REQUESTED'
@tracker.set_collection_status(status)
EVSS::RetrieveClaimsFromRemoteJob.perform_async(@user.uuid)
end
claims = status == 'REQUESTED' ? [] : claims_scope.all
@tracker.delete_collection_status unless status == 'REQUESTED'
[claims, status]
end
|
#claims_scope ⇒ Object
35
36
37
|
# File 'app/services/evss_claim_service_async.rb', line 35
def claims_scope
EVSSClaim.for_user(@user)
end
|
#update_from_remote(claim) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/services/evss_claim_service_async.rb', line 23
def update_from_remote(claim)
@tracker.claim_id = claim.id
status = @tracker.get_single_status
unless status
status = 'REQUESTED'
@tracker.set_single_status(status)
EVSS::UpdateClaimFromRemoteJob.perform_async(@user.uuid, claim.id)
end
@tracker.delete_single_status unless status == 'REQUESTED'
[claim, status]
end
|