Class: Cb::Clients::ApplicationExternal

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/clients/application_external.rb

Class Method Summary collapse

Class Method Details

.submit_app(app) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cb/clients/application_external.rb', line 16

def self.submit_app(app)
  fail Cb::IncomingParamIsWrongTypeException unless app.is_a?(Cb::Models::ApplicationExternal)

  my_api = Cb::Utils::Api.instance
  xml_hash = my_api.cb_post(Cb.configuration.uri_application_external, body: app.to_xml)

  if xml_hash.key? 'ApplyUrl'
    app.apply_url = xml_hash['ApplyUrl']
  else
    app.apply_url = ''
  end

  my_api.append_api_responses(app, xml_hash)
end