Class: PiiLog

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
rakelib/decision_review_repl.rb

Overview

PersonalInformationLog wrapper

Instance Method Summary collapse

Instance Method Details

#errorObject



239
240
241
# File 'rakelib/decision_review_repl.rb', line 239

def error
  data['error']
end

#error_messageObject



243
244
245
# File 'rakelib/decision_review_repl.rb', line 243

def error_message
  error&.send(:[], 'message').to_s
end

#error_message_categoryObject



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'rakelib/decision_review_repl.rb', line 247

def error_message_category
  if error_message.starts_with? 'Outage detected on DecisionReview beginning at'
    'Outage...'
  elsif error_message.starts_with? 'BackendServiceException: {:'
    match = error_message.match(/:code=>"(?<code>.*?)"/)
    if match
      code = match[:code]
      "BackendServiceException [#{code}]"
    else
      error_message
    end
  else
    error_message
  end
end

#helper_methodsObject



263
264
265
# File 'rakelib/decision_review_repl.rb', line 263

def helper_methods
  puts (methods - PersonalInformationLog.instance_methods - SimpleDelegator.instance_methods).sort
end