class DigitalNomadJobs::Company
Attributes
company_url[RW]
jobs[R]
name[RW]
Public Class Methods
all()
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 25 def self.all @@all end
create_by_name(name)
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 17 def self.create_by_name(name) company = self.new(name) end
find_by_name(name)
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 13 def self.find_by_name(name) @@all.find {|company| company.name == name} end
find_or_create_by_name(name)
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 21 def self.find_or_create_by_name(name) find_by_name(name) || create_by_name(name) end
list_companies()
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 38 def self.list_companies puts "" puts "============ COMPANIES NOW HIRING! =============".blue puts "================================================".blue puts "" all.each.with_index(1) do |company, i| puts "#{i}. #{company.name}" end puts "================================================".blue end
new(name)
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 7 def initialize(name) @name = name @jobs = [] @@all << self end
reset()
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 29 def self.reset @@all.clear end
Public Instance Methods
add_job(job)
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 33 def add_job(job) @jobs << job job.company = self.name end
print_company_jobs()
click to toggle source
# File lib/digital_nomad_jobs/company.rb, line 49 def print_company_jobs puts "" puts "#{self.name.upcase} IS LOOKING TO FILL THESE POSITIONS!".white.on_blue puts "-----------------------------------------------------------------------------------------------".blue jobs.each.with_index(1) do |job, i| puts "#{i}. #{job.title} - Posted:#{job.time_posted} Ago" puts "" puts "About: ".blue + "#{job.description}" puts "" puts "TO APPLY OR SEE MORE FROM #{self.name.upcase} VISIT: ".blue + "#{'https://remoteok.io' + self.company_url}" puts "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -".blue end puts "-----------------------------------------------------------------------------------------------".blue end