Class: Job
- Inherits:
-
Object
- Object
- Job
- Defined in:
- lib/indeed_scraper/job.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#company ⇒ Object
Returns the value of attribute company.
-
#description ⇒ Object
Returns the value of attribute description.
-
#job_url ⇒ Object
Returns the value of attribute job_url.
-
#location ⇒ Object
Returns the value of attribute location.
-
#salary ⇒ Object
Returns the value of attribute salary.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(job_hash) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(job_hash) ⇒ Job
Returns a new instance of Job.
6 7 8 9 |
# File 'lib/indeed_scraper/job.rb', line 6 def initialize(job_hash) job_hash.each {|key, value| self.send(("#{key}="), value)} @@all << self end |
Instance Attribute Details
#company ⇒ Object
Returns the value of attribute company.
2 3 4 |
# File 'lib/indeed_scraper/job.rb', line 2 def company @company end |
#description ⇒ Object
Returns the value of attribute description.
2 3 4 |
# File 'lib/indeed_scraper/job.rb', line 2 def description @description end |
#job_url ⇒ Object
Returns the value of attribute job_url.
2 3 4 |
# File 'lib/indeed_scraper/job.rb', line 2 def job_url @job_url end |
#location ⇒ Object
Returns the value of attribute location.
2 3 4 |
# File 'lib/indeed_scraper/job.rb', line 2 def location @location end |
#salary ⇒ Object
Returns the value of attribute salary.
2 3 4 |
# File 'lib/indeed_scraper/job.rb', line 2 def salary @salary end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/indeed_scraper/job.rb', line 2 def title @title end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/indeed_scraper/job.rb', line 18 def self.all @@all end |
.clear_all ⇒ Object
22 23 24 |
# File 'lib/indeed_scraper/job.rb', line 22 def self.clear_all @@all.clear end |
.create_from_collection(jobs_array) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/indeed_scraper/job.rb', line 11 def self.create_from_collection(jobs_array) jobs_array.each do |hash| new_job = self.new(hash) new_job end end |