class CareerProfiles::Occupation

Attributes

education[RW]
key_responsibilities[RW]
median_pay_2017[RW]
name[RW]
outlook_2016_26[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/career_profiles/occupation.rb, line 5
def self.all
  @@all
end
new(occupation_hash) click to toggle source
# File lib/career_profiles/occupation.rb, line 9
def initialize(occupation_hash)
  occupation_hash.each {|key, value| self.send(("#{key}="), value)}
  @@all << self
end
new_from_collection(occupation_array) click to toggle source
# File lib/career_profiles/occupation.rb, line 14
def self.new_from_collection(occupation_array)
  occupations= []
  occupation_array.each{|occupation_hash| occupations << self.new(occupation_hash)}
  occupations
end

Public Instance Methods

add_attributes(attributes_hash) click to toggle source
# File lib/career_profiles/occupation.rb, line 20
def add_attributes(attributes_hash)
  attributes_hash.each {|key, value| self.send(("#{key}="), value)}
end
display_occupation() click to toggle source
# File lib/career_profiles/occupation.rb, line 24
def display_occupation
  puts " "
  puts "NAME: #{self.name}"
  puts "------------------------"
  puts " "
  puts "KEY RESPONSIBILITIES"
  puts "----------------------"
  puts "#{self.key_responsibilities}"
  puts " "
  puts "EDUCATION REQUIRED"
  puts "----------------------"
  puts "#{self.education}"
  puts " "
  puts "JOB OUTLOOK 2016-2026"
  puts "----------------------"
  puts "#{self.outlook_2016_26}"
  puts " "
  puts "2017 MEDIAN PAY"
  puts "----------------------"
  puts "#{self.median_pay_2017}"
  puts ""
  puts "For more information and video click here: #{self.url}"
end