Class: Cb::Models::SavedSearch::SearchParameters

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ SearchParameters

Returns a new instance of SearchParameters.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/cb/models/implementations/saved_search.rb', line 111

def initialize(args = {})
  @boolean_operator      = args['BooleanOperator'] || ''
  @category              = args['Category'] || ''
  @job_category          = args['JobCategory'] || ''
  @education_code        = args['EducationCode'] || ''
  @emp_type              = args['EmpType'] || ''
  @exclude_company_names = args['ExcludeCompanyNames'] || ''
  @exclude_job_titles    = args['ExcludeJobTitles'] || ''
  @exclude_keywords      = args['ExcludeKeywords'] || ''
  @exclude_national      = args['ExcludeNational'].nil? ? false : args['ExcludeNational']
  @industry_codes        = args['IndustryCodes'] || ''
  @job_title             = args['JobTitle'] || ''
  @keywords              = args['Keywords'] || ''
  @location              = args['Location'] || ''
  @order_by              = args['OrderBy'] || ''
  @order_direction       = args['OrderDirection'] || ''
  @pay_high              = args['PayHigh'] || 0
  @pay_low               = args['PayLow'] || 0
  @pay_info_only         = args['PayInfoOnly'].nil? ? false : args['PayInfoOnly']
  @posted_within         = args['PostedWithin'] || 30
  @radius                = args['Radius'] || 30
  @specific_education    = args['SpecificEducation'].nil? ? false : args['SpecificEducation']
  @city                  = args['City'] || ''
  @state                 = args['State'] || ''
  @country               = args['Country'] || ''
  @company               = args['Company'] || ''
  @jc_position_level     = args['JCPositionLevel'] || ''
  @jc_location           = args['JCLocation'] || ''
  @jc_advertiser_flags   = args['JCAdvertiserFlags'] || ''
  @jc_job_nature         = args['JCJobNature'] || ''
end

Instance Attribute Details

#boolean_operatorObject

Returns the value of attribute boolean_operator.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def boolean_operator
  @boolean_operator
end

#categoryObject

Returns the value of attribute category.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def category
  @category
end

#cityObject

Returns the value of attribute city.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def city
  @city
end

#companyObject

Returns the value of attribute company.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def company
  @company
end

#countryObject

Returns the value of attribute country.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def country
  @country
end

#education_codeObject

Returns the value of attribute education_code.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def education_code
  @education_code
end

#emp_typeObject

Returns the value of attribute emp_type.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def emp_type
  @emp_type
end

#exclude_company_namesObject

Returns the value of attribute exclude_company_names.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def exclude_company_names
  @exclude_company_names
end

#exclude_job_titlesObject

Returns the value of attribute exclude_job_titles.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def exclude_job_titles
  @exclude_job_titles
end

#exclude_keywordsObject

Returns the value of attribute exclude_keywords.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def exclude_keywords
  @exclude_keywords
end

#exclude_nationalObject

Returns the value of attribute exclude_national.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def exclude_national
  @exclude_national
end

#industry_codesObject

Returns the value of attribute industry_codes.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def industry_codes
  @industry_codes
end

#jc_advertiser_flagsObject

Returns the value of attribute jc_advertiser_flags.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def jc_advertiser_flags
  @jc_advertiser_flags
end

#jc_job_natureObject

Returns the value of attribute jc_job_nature.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def jc_job_nature
  @jc_job_nature
end

#jc_locationObject

Returns the value of attribute jc_location.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def jc_location
  @jc_location
end

#jc_position_levelObject

Returns the value of attribute jc_position_level.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def jc_position_level
  @jc_position_level
end

#job_categoryObject

Returns the value of attribute job_category.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def job_category
  @job_category
end

#job_titleObject

Returns the value of attribute job_title.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def job_title
  @job_title
end

#keywordsObject

Returns the value of attribute keywords.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def keywords
  @keywords
end

#locationObject

Returns the value of attribute location.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def location
  @location
end

#order_byObject

Returns the value of attribute order_by.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def order_by
  @order_by
end

#order_directionObject

Returns the value of attribute order_direction.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def order_direction
  @order_direction
end

#pay_highObject

Returns the value of attribute pay_high.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def pay_high
  @pay_high
end

#pay_info_onlyObject

Returns the value of attribute pay_info_only.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def pay_info_only
  @pay_info_only
end

#pay_lowObject

Returns the value of attribute pay_low.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def pay_low
  @pay_low
end

#posted_withinObject

Returns the value of attribute posted_within.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def posted_within
  @posted_within
end

#radiusObject

Returns the value of attribute radius.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def radius
  @radius
end

#specific_educationObject

Returns the value of attribute specific_education.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def specific_education
  @specific_education
end

#stateObject

Returns the value of attribute state.



105
106
107
# File 'lib/cb/models/implementations/saved_search.rb', line 105

def state
  @state
end

Instance Method Details

#to_hashObject



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/cb/models/implementations/saved_search.rb', line 171

def to_hash
  {
    'BooleanOperator' => boolean_operator,
    'JobCategory' => job_category,
    'EducationCode' => education_code,
    'EmpType' => emp_type,
    'ExcludeCompanyNames' => exclude_company_names,
    'ExcludeJobTitles' => exclude_job_titles,
    'Country' => country,
    'IndustryCodes' => industry_codes,
    'JobTitle' => job_title,
    'Keywords' => keywords,
    'Location' => location,
    'OrderBy' => order_by,
    'OrderDirection' => order_direction,
    'PayHigh' => pay_high,
    'PayLow' => pay_low,
    'PostedWithin' => posted_within,
    'Radius' => radius,
    'SpecificEducation' => specific_education,
    'ExcludeNational' => exclude_national,
    'PayInfoOnly' => pay_info_only
  }
end

#to_xmlObject



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/cb/models/implementations/saved_search.rb', line 143

def to_xml
  "    <SearchParameters>\n      <BooleanOperator>\#{boolean_operator}</BooleanOperator>\n      <JobCategory>\#{category}</JobCategory>\n      <EducationCode>\#{education_code}</EducationCode>\n      <EmpType>\#{emp_type}</EmpType>\n      <ExcludeCompanyNames>\#{exclude_company_names}</ExcludeCompanyNames>\n      <ExcludeJobTitles>\#{exclude_job_titles}</ExcludeJobTitles>\n      <ExcludeKeywords>\#{exclude_keywords}</ExcludeKeywords>\n      <Country>\#{country}</Country>\n      <IndustryCodes>\#{industry_codes}</IndustryCodes>\n      <JobTitle>\#{job_title}</JobTitle>\n      <Keywords>\#{keywords}</Keywords>\n      <Location>\#{location}</Location>\n      <OrderBy>\#{order_by}</OrderBy>\n      <OrderDirection>\#{order_direction}</OrderDirection>\n      <PayHigh>\#{pay_high}</PayHigh>\n      <PayLow>\#{pay_low}</PayLow>\n      <PostedWithin>\#{posted_within}</PostedWithin>\n      <Radius>\#{radius}</Radius>\n      <SpecificEducation>\#{specific_education}</SpecificEducation>\n      <ExcludeNational>\#{exclude_national}</ExcludeNational>\n      <PayInfoOnly>\#{pay_info_only}</PayInfoOnly>\n    </SearchParameters>\n  eos\nend\n"