Class: Cb::Models::ApplicationExternal

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

Constant Summary collapse

IPATH_LENGTH =
10

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ ApplicationExternal

Returns a new instance of ApplicationExternal.



17
18
19
20
21
22
23
24
# File 'lib/cb/models/implementations/application_external.rb', line 17

def initialize(args = {})
  @job_did                = args[:job_did] || ''
  @email                  = args[:email] || ''
  @site_id                = args[:site_id] || 'cbnsv'
  @ipath                  = args[:ipath].slice(0, IPATH_LENGTH) rescue ''
  @is_external_link_apply = args[:is_external_link_apply] || false
  @apply_url              = ''
end

Instance Attribute Details

#apply_urlObject

Returns the value of attribute apply_url.



15
16
17
# File 'lib/cb/models/implementations/application_external.rb', line 15

def apply_url
  @apply_url
end

#emailObject

Returns the value of attribute email.



15
16
17
# File 'lib/cb/models/implementations/application_external.rb', line 15

def email
  @email
end

#ipathObject

Returns the value of attribute ipath.



15
16
17
# File 'lib/cb/models/implementations/application_external.rb', line 15

def ipath
  @ipath
end

Returns the value of attribute is_external_link_apply.



15
16
17
# File 'lib/cb/models/implementations/application_external.rb', line 15

def is_external_link_apply
  @is_external_link_apply
end

#job_didObject

Returns the value of attribute job_did.



15
16
17
# File 'lib/cb/models/implementations/application_external.rb', line 15

def job_did
  @job_did
end

#site_idObject

Returns the value of attribute site_id.



15
16
17
# File 'lib/cb/models/implementations/application_external.rb', line 15

def site_id
  @site_id
end

Instance Method Details

#to_xmlObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cb/models/implementations/application_external.rb', line 26

def to_xml
  ret = '<Request>'
  ret += "<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>"
  ret += "<EmailAddress>#{@email}</EmailAddress>"
  ret += "<JobDID>#{@job_did}</JobDID>"
  ret += "<SiteID>#{@site_id}</SiteID>"
  ret += "<IPath>#{@ipath}</IPath>"
  ret += "<IsExternalLinkApply>#{@is_external_link_apply}</IsExternalLinkApply>"
  ret += "<HostSite>#{Cb.configuration.host_site}</HostSite>"
  ret += '</Request>'
  ret
end