Class: Post911SOB::DGIB::Client

Inherits:
Common::Client::Base show all
Includes:
Common::Client::Concerns::Monitoring
Defined in:
lib/post911_sob/dgib/client.rb

Constant Summary collapse

BENEFIT_TYPE =
'Chapter33'

Instance Method Summary collapse

Methods included from Common::Client::Concerns::Monitoring

#increment, #increment_failure, #increment_total, #with_monitoring

Methods inherited from Common::Client::Base

#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Constructor Details

#initialize(claimant_id) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
# File 'lib/post911_sob/dgib/client.rb', line 16

def initialize(claimant_id)
  @claimant_id = claimant_id

  super()
end

Instance Method Details

#end_pointObject (private)



31
32
33
# File 'lib/post911_sob/dgib/client.rb', line 31

def end_point
  "transferees/#{@claimant_id}/toe"
end

#get_entitlement_transferred_outObject



22
23
24
25
26
27
# File 'lib/post911_sob/dgib/client.rb', line 22

def get_entitlement_transferred_out
  # TO-DO add monitoring and serialized response
  # TO-DO Filter response by chapter33 benefit type
  options = { timeout: 60 }
  perform(:get, end_point, {}, request_headers, options)
end

#request_headersObject (private)



35
36
37
38
39
# File 'lib/post911_sob/dgib/client.rb', line 35

def request_headers
  {
    Authorization: "Bearer #{Post911SOB::DGIB::AuthenticationTokenService.call}"
  }
end