Class: Oodler::Client
Instance Attribute Summary collapse
-
#http_options ⇒ Object
readonly
Returns the value of attribute http_options.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #company_attribute(title) ⇒ Object
- #get(path, options = {}) ⇒ Object
- #industry_attribute(title) ⇒ Object
-
#initialize(key = Oodler.key, options = {}) ⇒ Client
constructor
A new instance of Client.
- #job_title_attribute(title) ⇒ Object
- #job_type_attribute(string) ⇒ Object
-
#listing(options = {}) ⇒ Object
the generic pash a hash version example client.listing(:region=>“chicago”, :category => “vehicle/car”) returns an OodleResponse.
-
#search(region, options = {}) ⇒ Object
client.search(“chicago”, =>“vehicle/cars”).
-
#search_by_category(region, category, options = {}) ⇒ Object
helper method - client.search_by_category(“chicago”, “vehicle/car”).
-
#usa_job_search(options) ⇒ Object
specify the :location key for city search, i.e :location=>“Houston, Tx” allow job specializaton, i.e.
- #web_client ⇒ Object
Constructor Details
#initialize(key = Oodler.key, options = {}) ⇒ Client
Returns a new instance of Client.
7 8 9 |
# File 'lib/oodler/client.rb', line 7 def initialize(key=Oodler.key,={}) @key, @http_options = key, end |
Instance Attribute Details
#http_options ⇒ Object (readonly)
Returns the value of attribute http_options.
5 6 7 |
# File 'lib/oodler/client.rb', line 5 def @http_options end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/oodler/client.rb', line 5 def key @key end |
Instance Method Details
#company_attribute(title) ⇒ Object
65 66 67 |
# File 'lib/oodler/client.rb', line 65 def company_attribute(title) "company_#{title}" end |
#get(path, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/oodler/client.rb', line 16 def get(path, ={}) path = "/listings#{path}" delete_empty_keys() validate_parameters() response = web_client.get(path, ) raise_errors(response) response.body end |
#industry_attribute(title) ⇒ Object
61 62 63 |
# File 'lib/oodler/client.rb', line 61 def industry_attribute(title) "industry_#{title}" end |
#job_title_attribute(title) ⇒ Object
57 58 59 |
# File 'lib/oodler/client.rb', line 57 def job_title_attribute(title) "job_title_#{title}" end |
#job_type_attribute(string) ⇒ Object
69 70 71 |
# File 'lib/oodler/client.rb', line 69 def job_type_attribute(string) "job_type_#{title}" end |
#listing(options = {}) ⇒ Object
the generic pash a hash version example client.listing(:region=>“chicago”, :category => “vehicle/car”) returns an OodleResponse
51 52 53 54 55 |
# File 'lib/oodler/client.rb', line 51 def listing(={}) path = "" = {:query =>} OodleResponse.from_xml(get(path, )) end |
#search(region, options = {}) ⇒ Object
client.search(“chicago”, =>“vehicle/cars”)
26 27 28 29 |
# File 'lib/oodler/client.rb', line 26 def search( region, ={}) .merge!({:region => region}) self.listing() end |
#search_by_category(region, category, options = {}) ⇒ Object
helper method - client.search_by_category(“chicago”, “vehicle/car”)
32 33 34 35 36 37 |
# File 'lib/oodler/client.rb', line 32 def search_by_category(region,category, ={}) .merge!({:region => region}) if region .merge!({:category => category}) if category self.listing() end |
#usa_job_search(options) ⇒ Object
specify the :location key for city search, i.e :location=>“Houston, Tx” allow job specializaton, i.e. job/tech
41 42 43 44 45 |
# File 'lib/oodler/client.rb', line 41 def usa_job_search() .merge!({:region => "usa"}) .merge!({:category => "job"}) unless && [:category] self.listing() end |