Class: Cb::TalentNetworkApi

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

Class Method Summary collapse

Class Method Details

.join_form_branding(tndid) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cb/clients/talent_network_api.rb', line 19

def self.join_form_branding(tndid)
  ## Gets branding information (stylesheets, copytext, etc...) for the join form.
  my_api = Cb::Utils::Api.new

  json_hash = my_api.cb_get_secure("#{Cb.configuration.uri_tn_join_form_branding}/#{tndid}/json")

    if json_hash.has_key? 'Branding'
    tn_join_form_branding = TalentNetwork::JoinFormBranding.new(json_hash['Branding'])
    end

  my_api.append_api_responses(tn_join_form_branding, json_hash)

  return tn_join_form_branding

end

.join_form_geography(tnlanguage = "USEnglish") ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/cb/clients/talent_network_api.rb', line 35

def self.join_form_geography(tnlanguage="USEnglish")
  ## Gets locations needed to fill the Geography question from the Join Form Question API
  my_api = Cb::Utils::Api.new
  json_hash = my_api.cb_get_secure("#{Cb.configuration.uri_tn_join_form_geo}", :query=>{:TNLanguage=>"#{tnlanguage}"})

  geo_dropdown = TalentNetwork::JoinFormGeo.new(json_hash)
  my_api.append_api_responses(geo_dropdown, json_hash)

  return geo_dropdown
end

.join_form_questions(tndid) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/cb/clients/talent_network_api.rb', line 8

def self.join_form_questions(tndid)
  ## Load the join form questions for a TalentNetworkDID
  my_api = Cb::Utils::Api.new()
  json_hash = my_api.cb_get_secure("#{Cb.configuration.uri_tn_join_questions}/#{tndid}/json")

  tn_questions_collection = TalentNetwork.new(json_hash)
  my_api.append_api_responses(tn_questions_collection, json_hash)

  return tn_questions_collection
end

.member_create(args = {}) ⇒ Object



46
47
48
49
50
51
52
53
54
# File 'lib/cb/clients/talent_network_api.rb', line 46

def self.member_create(args={})
  ## Creates a member based on the form built with the Join Form Questions API call
  my_api = Cb::Utils::Api.new
  tn_member = TalentNetwork::Member.new(args)
    json_hash = my_api.cb_post("#{Cb.configuration.uri_tn_member_create}/json", :body => tn_member.to_xml )
    my_api.append_api_responses(json_hash, json_hash)

  return json_hash
end

.tn_job_information(job_did, join_form_intercept = "true") ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/cb/clients/talent_network_api.rb', line 56

def self.tn_job_information(job_did, join_form_intercept="true")
  my_api = Cb::Utils::Api.new
  json_hash = my_api.cb_get_secure("#{Cb.configuration.uri_tn_job_info}/#{job_did}/json", :query=> {
     :RequestJoinFormIntercept=>join_form_intercept})

    if json_hash.has_key? 'Response'
    tn_job_info = TalentNetwork::JobInfo.new(json_hash['Response'])
    end

  my_api.append_api_responses(tn_job_info, json_hash)

  return tn_job_info
end