Class: Cb::CbSavedJobSearch

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ CbSavedJobSearch

Returns a new instance of CbSavedJobSearch.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/cb/models/cb_saved_job_search.rb', line 10

def initialize(args={})
  @hostsite                   = args[:HostSite] || ''
  @cobrand                    = args[:Cobrand] || ''
  @search_name                = args[:SearchName] || ''
  @site_id                    = args[:SiteId] || ''
  @boolean_operator           = args[:BooleanOperator] || ''
  @category                   = args[:Category] || ''
  @education_code             = args[:EducationCode] || ''
  @specific_education         = args[:SpecificEducation] || false
  @emp_type                   = args[:EmpType] || ''
  @exclude_company_names      = args[:ExcludeCompanyNames] || ''
  @exclude_job_titles         = args[:ExcludeJobTitles] || ''
  @exclude_national           = args[:ExcludeNational] || false
  @industry_codes             = args[:IndustryCodes] || ''
  @keywords                   = args[:Keywords] || ''
  @order_by                   = args[:OrderBy] || ''
  @order_direction            = args[:OrderDirection] || ''
  @radius                     = args[:Radius] || 30
  @pay_high                   = args[:PayHigh] || 0
  @pay_low                    = args[:PayLow] ||  0
  @posted_within              = args[:PostedWithin] || 30
  @pay_info_only              = args[:PayInfoOnly] || false
  @location                   = args[:Location] || ''
  @job_category               = args[:JobCategory] || ''
  @company                    = args[:Company] || ''
  @city                       = args[:City] || ''
  @state                      = args[:State] || ''
  @is_daily_email             = args[:IsDailyEmail] || ''
  @external_user_id           = args[:ExternalUserId] || ''
  @dev_key                    = args[:DeveloperKey] || "#{Cb.configuration.dev_key}"
end

Instance Attribute Details

#boolean_operator ⇒ Object

Returns the value of attribute boolean_operator.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def boolean_operator
  @boolean_operator
end

#category ⇒ Object

Returns the value of attribute category.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def category
  @category
end

#city ⇒ Object

Returns the value of attribute city.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def city
  @city
end

#cobrand ⇒ Object

Returns the value of attribute cobrand.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def cobrand
  @cobrand
end

#company ⇒ Object

Returns the value of attribute company.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def company
  @company
end

#dev_key ⇒ Object

Returns the value of attribute dev_key.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def dev_key
  @dev_key
end

#education_code ⇒ Object

Returns the value of attribute education_code.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def education_code
  @education_code
end

#emp_type ⇒ Object

Returns the value of attribute emp_type.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def emp_type
  @emp_type
end

#exclude_company_names ⇒ Object

Returns the value of attribute exclude_company_names.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def exclude_company_names
  @exclude_company_names
end

#exclude_job_titles ⇒ Object

Returns the value of attribute exclude_job_titles.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def exclude_job_titles
  @exclude_job_titles
end

#exclude_national ⇒ Object

Returns the value of attribute exclude_national.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def exclude_national
  @exclude_national
end

#external_user_id ⇒ Object

Returns the value of attribute external_user_id.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def external_user_id
  @external_user_id
end

#hostsite ⇒ Object

Returns the value of attribute hostsite.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def hostsite
  @hostsite
end

#industry_codes ⇒ Object

Returns the value of attribute industry_codes.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def industry_codes
  @industry_codes
end

#is_daily_email ⇒ Object

Returns the value of attribute is_daily_email.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def is_daily_email
  @is_daily_email
end

#job_category ⇒ Object

Returns the value of attribute job_category.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def job_category
  @job_category
end

#keywords ⇒ Object

Returns the value of attribute keywords.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def keywords
  @keywords
end

#location ⇒ Object

Returns the value of attribute location.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def location
  @location
end

#order_by ⇒ Object

Returns the value of attribute order_by.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def order_by
  @order_by
end

#order_direction ⇒ Object

Returns the value of attribute order_direction.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def order_direction
  @order_direction
end

#pay_high ⇒ Object

Returns the value of attribute pay_high.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def pay_high
  @pay_high
end

#pay_info_only ⇒ Object

Returns the value of attribute pay_info_only.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def pay_info_only
  @pay_info_only
end

#pay_low ⇒ Object

Returns the value of attribute pay_low.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def pay_low
  @pay_low
end

#posted_within ⇒ Object

Returns the value of attribute posted_within.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def posted_within
  @posted_within
end

#radius ⇒ Object

Returns the value of attribute radius.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def radius
  @radius
end

#search_name ⇒ Object

Returns the value of attribute search_name.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def search_name
  @search_name
end

#site_id ⇒ Object

Returns the value of attribute site_id.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def site_id
  @site_id
end

#specific_education ⇒ Object

Returns the value of attribute specific_education.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def specific_education
  @specific_education
end

#state ⇒ Object

Returns the value of attribute state.



4
5
6
# File 'lib/cb/models/cb_saved_job_search.rb', line 4

def state
  @state
end

Instance Method Details

#to_xml ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/cb/models/cb_saved_job_search.rb', line 42

def to_xml
  ret =  "<Request>"
  ret += "<HostSite>#{@hostsite}</HostSite>"
  ret += "<Cobrand>#{@cobrand}</Cobrand>"
  ret += "<SearchName>#{@search_name}</SearchName>"
  ret += "<SearchParameters>"
  ret += "<BooleanOperator>#{@boolean_operator}</BooleanOperator>"
  ret += "<Category>#{@category}</Category>"
  ret += "<EducationCode>#{@education_code}</EducationCode>"
  ret += "<SpecificEducation>#{@specific_education}</SpecificEducation>"
  ret += "<EmpType>#{@emp_type}</EmpType>"
  ret += "<ExcludeCompanyNames>#{@exclude_company_names}</ExcludeCompanyNames>"
  ret += "<ExcludeJobTitles>#{@exclude_job_titles}</ExcludeJobTitles>"
  ret += "<ExcludeNational>#{@exclude_national}</ExcludeNational>"
  ret += "<IndustryCodes>#{@industry_codes}</IndustryCodes>"
  ret += "<Keywords>#{@keywords}</Keywords>"
  ret += "<OrderBy>#{@order_by}</OrderBy>"
  ret += "<OrderDirection>#{@order_direction}</OrderDirection>"
  ret += "<Radius>#{@radius}</Radius>"
  ret += "<PayHigh>#{@pay_high}</PayHigh>"
  ret += "<PayLow>#{@pay_high}</PayLow>"
  ret += "<PostedWithin>#{@posted_within}</PostedWithin>"
  ret += "<PayInfoOnly>#{@pay_info_only}</PayInfoOnly>"
  ret += "<Location>#{@location}</Location>"
  ret += "<JobCategory>#{@job_category}</JobCategory>"
  ret += "<Company>#{@company}</Company>"
  ret += "<City>#{@city}</City>"
  ret += "<State>#{@state}</State>"
  ret += "</SearchParameters>"
  ret += "<IsDailyEmail>#{@is_daily_email}</IsDailyEmail>"
  ret += "<ExternalUserID>#{@external_user_id}</ExternalUserID>"
  ret += "<DeveloperKey>#{@dev_key}</DeveloperKey>"
  ret += "</Request>"

  ret
end