Class: Cb::Clients::ApplicationExternal

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

Class Method Summary collapse

Methods inherited from Base

cb_client, headers

Class Method Details

.submit_app(app) ⇒ Object



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

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

  xml_hash = cb_client.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

  cb_client.append_api_responses(app, xml_hash)
end