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.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/cb/models/implementations/saved_search.rb', line 107

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

Instance Attribute Details

#boolean_operatorObject

Returns the value of attribute boolean_operator.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def boolean_operator
  @boolean_operator
end

#categoryObject

Returns the value of attribute category.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def category
  @category
end

#countryObject

Returns the value of attribute country.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def country
  @country
end

#education_codeObject

Returns the value of attribute education_code.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def education_code
  @education_code
end

#emp_typeObject

Returns the value of attribute emp_type.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def emp_type
  @emp_type
end

#exclude_company_namesObject

Returns the value of attribute exclude_company_names.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def exclude_company_names
  @exclude_company_names
end

#exclude_job_titlesObject

Returns the value of attribute exclude_job_titles.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def exclude_job_titles
  @exclude_job_titles
end

#exclude_keywordsObject

Returns the value of attribute exclude_keywords.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def exclude_keywords
  @exclude_keywords
end

#exclude_nationalObject

Returns the value of attribute exclude_national.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def exclude_national
  @exclude_national
end

#industry_codesObject

Returns the value of attribute industry_codes.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def industry_codes
  @industry_codes
end

#job_titleObject

Returns the value of attribute job_title.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def job_title
  @job_title
end

#keywordsObject

Returns the value of attribute keywords.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def keywords
  @keywords
end

#locationObject

Returns the value of attribute location.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def location
  @location
end

#order_byObject

Returns the value of attribute order_by.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def order_by
  @order_by
end

#order_directionObject

Returns the value of attribute order_direction.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def order_direction
  @order_direction
end

#pay_highObject

Returns the value of attribute pay_high.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def pay_high
  @pay_high
end

#pay_info_onlyObject

Returns the value of attribute pay_info_only.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def pay_info_only
  @pay_info_only
end

#pay_lowObject

Returns the value of attribute pay_low.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def pay_low
  @pay_low
end

#posted_withinObject

Returns the value of attribute posted_within.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def posted_within
  @posted_within
end

#radiusObject

Returns the value of attribute radius.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def radius
  @radius
end

#specific_educationObject

Returns the value of attribute specific_education.



102
103
104
# File 'lib/cb/models/implementations/saved_search.rb', line 102

def specific_education
  @specific_education
end

Instance Method Details

#to_xml(args = {}) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/cb/models/implementations/saved_search.rb', line 132

def to_xml(args = {})
  request = {
      'SearchParameters' => {
          'BooleanOperator' =>    args[:boolean_operator],
          'JobCategory'     =>    args[:category],
          'EducationCode'     =>  args[:education_code],
          'EmpType'         =>    args[:emp_type],
          'ExcludeCompanyNames'=> args[:exclude_company_names],
          'ExcludeJobTitles'  =>  args[:exclude_job_titles],
          'ExcludeKeywords'   =>  args[:exclude_keywords],
          'Country'           =>  args[:country],
          'IndustryCodes'     =>  args[:industry_codes],
          'JobTitle'          =>  args[:job_title],
          'Keywords'          =>  args[:keywords],
          'Location'          =>  args[:location],
          'OrderBy'           =>  args[:order_by],
          'OrderDirection'    =>  args[:order_direction],
          'PayHigh'           =>  args[:pay_high],
          'PayLow'            =>  args[:pay_low],
          'PostedWithin'      =>  args[:posted_within],
          'Radius'            =>  args[:radius],
          'SpecificEducation' =>  args[:specific_education],
          'ExcludeNational'   =>  args[:exclude_national],
          'PayInfoOnly'       =>  args[:pay_info_only]
      }
  }
  XmlSimple.xml_out([request], 'SuppressEmpty' => nil)
end