class RemoteDevJobs::CLI::Job

Attributes

company[RW]
company_site[RW]
description[RW]
job_url[RW]
location[RW]
number[RW]
position[RW]
seniority[RW]

Public Class Methods

all() click to toggle source
# File lib/remote_dev_jobs/Job.rb, line 36
def self.all
  @@all
end
create_from_collection(jobs_array) click to toggle source
# File lib/remote_dev_jobs/Job.rb, line 14
def self.create_from_collection(jobs_array)
  jobs_array.each_with_index do |job, index|
    if job
      job_hash = {
        number: index + 1,
        company: job[:company],
        location: job[:location],
        position: job[:position],
        seniority: job[:seniority],
        job_url: job[:job_url]
      }
      self.new(job_hash)
    end
  end
end
new(job_hash) click to toggle source
# File lib/remote_dev_jobs/Job.rb, line 7
def initialize(job_hash)
  job_hash.each do |attr, value|
    self.send("#{attr}=", value)
  end
  @@all << self
end

Public Instance Methods

add_job_attributes(attributes_hash) click to toggle source
# File lib/remote_dev_jobs/Job.rb, line 30
def add_job_attributes(attributes_hash)
  attributes_hash.each do |attr, value|
    self.send("#{attr}=", value)
  end
end