Class: Stackable
- Inherits:
-
Object
- Object
- Stackable
- Defined in:
- lib/stackable.rb
Instance Method Summary collapse
- #all_companies ⇒ Object
- #all_jobs ⇒ Object
- #companies_by_benefits(benefits = []) ⇒ Object
- #get(url) ⇒ Object
- #get_companies_by_tags(tags = []) ⇒ Object
- #get_company(company_id) ⇒ Object
- #get_job(job_id) ⇒ Object
- #get_jobs_by_tags(tags = []) ⇒ Object
- #jobs_by_location(location) ⇒ Object
- #relocation_offered? ⇒ Boolean
- #remote_working? ⇒ Boolean
- #senior ⇒ Object
Instance Method Details
#all_companies ⇒ Object
25 26 27 |
# File 'lib/stackable.rb', line 25 def all_companies get('http://stackable.herokuapp.com/api/companies') end |
#all_jobs ⇒ Object
12 13 14 |
# File 'lib/stackable.rb', line 12 def all_jobs get('http://stackable.herokuapp.com/api/jobs') end |
#companies_by_benefits(benefits = []) ⇒ Object
50 51 52 53 |
# File 'lib/stackable.rb', line 50 def companies_by_benefits(benefits=[]) params = benefits.join('&') get("http://stackable.herokuapp.com/api/companies/benefits/#{params}") end |
#get(url) ⇒ Object
7 8 9 10 |
# File 'lib/stackable.rb', line 7 def get(url) response = HTTParty.get(url) JSON.parse(response.body) end |
#get_companies_by_tags(tags = []) ⇒ Object
33 34 35 36 |
# File 'lib/stackable.rb', line 33 def (=[]) params = .join('&') get("http://stackable.herokuapp.com/api/companies/tags/#{params}") end |
#get_company(company_id) ⇒ Object
29 30 31 |
# File 'lib/stackable.rb', line 29 def get_company(company_id) get("http://stackable.herokuapp.com/api/companies/#{company_id}") end |
#get_job(job_id) ⇒ Object
16 17 18 |
# File 'lib/stackable.rb', line 16 def get_job(job_id) get("http://stackable.herokuapp.com/api/jobs/#{job_id}") end |
#get_jobs_by_tags(tags = []) ⇒ Object
20 21 22 23 |
# File 'lib/stackable.rb', line 20 def (=[]) params = .join('&') get("http://stackable.herokuapp.com/api/jobs/tags/#{params}") end |
#jobs_by_location(location) ⇒ Object
55 56 57 58 |
# File 'lib/stackable.rb', line 55 def jobs_by_location(location) params = location get("http://stackable.herokuapp.com/api/jobs/location/#{params}") end |
#relocation_offered? ⇒ Boolean
38 39 40 |
# File 'lib/stackable.rb', line 38 def relocation_offered? get("http://stackable.herokuapp.com/api/relocation") end |
#remote_working? ⇒ Boolean
42 43 44 |
# File 'lib/stackable.rb', line 42 def remote_working? get("http://stackable.herokuapp.com/api/remote") end |
#senior ⇒ Object
46 47 48 |
# File 'lib/stackable.rb', line 46 def senior get("http://stackable.herokuapp.com/api/senior") end |