Class: Cb::Models::SavedSearch
- Inherits:
-
Object
- Object
- Cb::Models::SavedSearch
- Defined in:
- lib/cb/models/implementations/saved_search.rb
Defined Under Namespace
Classes: Delete, SearchParameters
Instance Attribute Summary collapse
-
#boolean_operator ⇒ Object
Returns the value of attribute boolean_operator.
-
#browser_id ⇒ Object
Returns the value of attribute browser_id.
-
#category ⇒ Object
Returns the value of attribute category.
-
#city ⇒ Object
Returns the value of attribute city.
-
#cobrand ⇒ Object
Returns the value of attribute cobrand.
-
#company ⇒ Object
Returns the value of attribute company.
-
#country ⇒ Object
Returns the value of attribute country.
-
#did ⇒ Object
Returns the value of attribute did.
-
#education_code ⇒ Object
Returns the value of attribute education_code.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#email_delivery_day ⇒ Object
Returns the value of attribute email_delivery_day.
-
#emp_type ⇒ Object
Returns the value of attribute emp_type.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#exclude_company_names ⇒ Object
Returns the value of attribute exclude_company_names.
-
#exclude_job_titles ⇒ Object
Returns the value of attribute exclude_job_titles.
-
#exclude_national ⇒ Object
Returns the value of attribute exclude_national.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#external_user_id ⇒ Object
Returns the value of attribute external_user_id.
-
#host_site ⇒ Object
Returns the value of attribute host_site.
-
#industry_codes ⇒ Object
Returns the value of attribute industry_codes.
-
#is_daily_email ⇒ Object
Returns the value of attribute is_daily_email.
-
#job_category ⇒ Object
Returns the value of attribute job_category.
-
#job_search_url ⇒ Object
Returns the value of attribute job_search_url.
-
#jrdid ⇒ Object
Returns the value of attribute jrdid.
-
#keywords ⇒ Object
Returns the value of attribute keywords.
-
#location ⇒ Object
Returns the value of attribute location.
-
#order_by ⇒ Object
Returns the value of attribute order_by.
-
#order_direction ⇒ Object
Returns the value of attribute order_direction.
-
#pay_high ⇒ Object
Returns the value of attribute pay_high.
-
#pay_info_only ⇒ Object
Returns the value of attribute pay_info_only.
-
#pay_low ⇒ Object
Returns the value of attribute pay_low.
-
#posted_within ⇒ Object
Returns the value of attribute posted_within.
-
#radius ⇒ Object
Returns the value of attribute radius.
-
#search_name ⇒ Object
Returns the value of attribute search_name.
-
#search_parameters ⇒ Object
Returns the value of attribute search_parameters.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#site_id ⇒ Object
Returns the value of attribute site_id.
-
#specific_education ⇒ Object
Returns the value of attribute specific_education.
-
#state ⇒ Object
Returns the value of attribute state.
-
#test ⇒ Object
Returns the value of attribute test.
-
#user_oauth_token ⇒ Object
Returns the value of attribute user_oauth_token.
Instance Method Summary collapse
- #create_anon_to_xml ⇒ Object
- #create_to_json ⇒ Object
- #delete_anon_to_xml ⇒ Object
-
#initialize(args = {}) ⇒ SavedSearch
constructor
A new instance of SavedSearch.
- #update_to_json ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ SavedSearch
Returns a new instance of SavedSearch.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cb/models/implementations/saved_search.rb', line 21 def initialize(args = {}) @host_site = args['HostSite'] || args[:host_site] || '' @cobrand = args['Cobrand'] || args[:cobrand] || '' @search_name = args['SearchName'] || args[:search_name] || '' @site_id = args['SiteId'] || args[:site_id] || '' @is_daily_email = args['IsDailyEmail'] || args[:is_daily_email] || false @email_delivery_day = args['EmailDeliveryDay'] || args[:email_delivery_day] || '' @job_search_url = args['JobSearchUrl'] || args[:job_search_url] || '' @external_id = args['ExternalID'] || args[:external_id] || '' @external_user_id = args['ExternalUserID'] || args[:external_user_id] || '' @browser_id = args['BrowserID'] || args[:browser_id] || nil @session_id = args['SessionID'] || args[:session_id] || '' @email_address = args['EmailAddress'] || args[:email_address] || '' @did = args['DID'] || args[:did] || '' @user_oauth_token = args['userOAuthToken'] || args[:user_oauth_token] || '' @search_parameters = SearchParameters.new(args['SavedSearchParameters'] || {}) end |
Instance Attribute Details
#boolean_operator ⇒ Object
Returns the value of attribute boolean_operator.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def boolean_operator @boolean_operator end |
#browser_id ⇒ Object
Returns the value of attribute browser_id.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def browser_id @browser_id end |
#category ⇒ Object
Returns the value of attribute category.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def category @category end |
#city ⇒ Object
Returns the value of attribute city.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def city @city end |
#cobrand ⇒ Object
Returns the value of attribute cobrand.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def cobrand @cobrand end |
#company ⇒ Object
Returns the value of attribute company.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def company @company end |
#country ⇒ Object
Returns the value of attribute country.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def country @country end |
#did ⇒ Object
Returns the value of attribute did.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def did @did end |
#education_code ⇒ Object
Returns the value of attribute education_code.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def education_code @education_code end |
#email_address ⇒ Object
Returns the value of attribute email_address.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def email_address @email_address end |
#email_delivery_day ⇒ Object
Returns the value of attribute email_delivery_day.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def email_delivery_day @email_delivery_day end |
#emp_type ⇒ Object
Returns the value of attribute emp_type.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def emp_type @emp_type end |
#errors ⇒ Object
Returns the value of attribute errors.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def errors @errors end |
#exclude_company_names ⇒ Object
Returns the value of attribute exclude_company_names.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def exclude_company_names @exclude_company_names end |
#exclude_job_titles ⇒ Object
Returns the value of attribute exclude_job_titles.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def exclude_job_titles @exclude_job_titles end |
#exclude_national ⇒ Object
Returns the value of attribute exclude_national.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def exclude_national @exclude_national end |
#external_id ⇒ Object
Returns the value of attribute external_id.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def external_id @external_id end |
#external_user_id ⇒ Object
Returns the value of attribute external_user_id.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def external_user_id @external_user_id end |
#host_site ⇒ Object
Returns the value of attribute host_site.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def host_site @host_site end |
#industry_codes ⇒ Object
Returns the value of attribute industry_codes.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def industry_codes @industry_codes end |
#is_daily_email ⇒ Object
Returns the value of attribute is_daily_email.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def is_daily_email @is_daily_email end |
#job_category ⇒ Object
Returns the value of attribute job_category.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def job_category @job_category end |
#job_search_url ⇒ Object
Returns the value of attribute job_search_url.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def job_search_url @job_search_url end |
#jrdid ⇒ Object
Returns the value of attribute jrdid.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def jrdid @jrdid end |
#keywords ⇒ Object
Returns the value of attribute keywords.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def keywords @keywords end |
#location ⇒ Object
Returns the value of attribute location.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def location @location end |
#order_by ⇒ Object
Returns the value of attribute order_by.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def order_by @order_by end |
#order_direction ⇒ Object
Returns the value of attribute order_direction.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def order_direction @order_direction end |
#pay_high ⇒ Object
Returns the value of attribute pay_high.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def pay_high @pay_high end |
#pay_info_only ⇒ Object
Returns the value of attribute pay_info_only.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def pay_info_only @pay_info_only end |
#pay_low ⇒ Object
Returns the value of attribute pay_low.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def pay_low @pay_low end |
#posted_within ⇒ Object
Returns the value of attribute posted_within.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def posted_within @posted_within end |
#radius ⇒ Object
Returns the value of attribute radius.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def radius @radius end |
#search_name ⇒ Object
Returns the value of attribute search_name.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def search_name @search_name end |
#search_parameters ⇒ Object
Returns the value of attribute search_parameters.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def search_parameters @search_parameters end |
#session_id ⇒ Object
Returns the value of attribute session_id.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def session_id @session_id end |
#site_id ⇒ Object
Returns the value of attribute site_id.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def site_id @site_id end |
#specific_education ⇒ Object
Returns the value of attribute specific_education.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def specific_education @specific_education end |
#state ⇒ Object
Returns the value of attribute state.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def state @state end |
#test ⇒ Object
Returns the value of attribute test.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def test @test end |
#user_oauth_token ⇒ Object
Returns the value of attribute user_oauth_token.
14 15 16 |
# File 'lib/cb/models/implementations/saved_search.rb', line 14 def user_oauth_token @user_oauth_token end |
Instance Method Details
#create_anon_to_xml ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/cb/models/implementations/saved_search.rb', line 53 def create_anon_to_xml <<-eos <Request> <HostSite>#{host_site}</HostSite> <Cobrand>#{cobrand}</Cobrand> <BrowserID>#{browser_id}</BrowserID> <SessionID>#{session_id}</SessionID> <SiteID>#{site_id}</SiteID> <Test>false</Test> <EmailAddress>#{email_address}</EmailAddress> <SearchName>#{search_name}</SearchName> #{search_parameters.to_xml} <IsDailyEmail>#{is_daily_email.to_s.upcase}</IsDailyEmail> <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey> </Request> eos end |
#create_to_json ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/cb/models/implementations/saved_search.rb', line 39 def create_to_json hash = { 'SiteID' => site_id, 'Cobrand' => cobrand, 'EmailDeliveryDay' => email_delivery_day, 'IsDailyEmail' => is_daily_email, 'userOAuthToken' => user_oauth_token, 'HostSite' => host_site, 'SearchName' => search_name, 'SavedSearchParameters' => search_parameters.to_hash } hash.to_json end |
#delete_anon_to_xml ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/cb/models/implementations/saved_search.rb', line 87 def delete_anon_to_xml <<-eos <Request> <ExternalID>#{external_id}</ExternalID> <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey> <Test>false</Test> </Request> eos end |
#update_to_json ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/cb/models/implementations/saved_search.rb', line 71 def update_to_json hash = { 'DID' => did, 'SearchName' => search_name, 'HostSite' => host_site, 'SiteID' => site_id, 'Cobrand' => cobrand, 'EmailDeliveryDay' => email_delivery_day, 'IsDailyEmail' => is_daily_email, 'userOAuthToken' => user_oauth_token, 'SavedSearchParameters' => search_parameters.to_hash } hash['EmailDeliveryDay'] = email_delivery_day unless is_daily_email hash.to_json end |