Class: VAProfile::Models::Message

Inherits:
Base
  • Object
show all
Defined in:
lib/va_profile/models/message.rb

Constant Summary collapse

SEVERITY_LEVELS =
%w[
  INFO
  WARN
  ERROR
  FATAL
].freeze

Constants inherited from Base

Base::SOURCE_SYSTEM

Class Method Summary collapse

Class Method Details

.build_from(body) ⇒ VAProfile::Models::Message

Converts a decoded JSON response from VAProfile to an instance of the Message model

Parameters:

  • body (Hash)

    the decoded response body from VAProfile

Returns:



30
31
32
33
34
35
36
37
38
# File 'lib/va_profile/models/message.rb', line 30

def self.build_from(body)
  VAProfile::Models::Message.new(
    code: body['code'],
    key: body['key'],
    retryable: body['potentially_self_correcting_on_retry'],
    severity: body['severity'],
    text: body['text']
  )
end