class CareerProfiles::CareerInterest
Attributes
name[RW]
occupations[RW]
Public Class Methods
all()
click to toggle source
# File lib/career_profiles/career_interest.rb, line 15 def self.all @@all end
new(career_interest_hash)
click to toggle source
# File lib/career_profiles/career_interest.rb, line 6 def initialize(career_interest_hash) career_interest_hash.each {|key, value| self.send(("#{key}="), value)} @@all << self end
new_from_collection(career_interest_array)
click to toggle source
# File lib/career_profiles/career_interest.rb, line 11 def self.new_from_collection(career_interest_array) career_interest_array.each {|career_interest_hash| self.new(career_interest_hash)} end
Public Instance Methods
add_occupations(occupation_hash)
click to toggle source
# File lib/career_profiles/career_interest.rb, line 19 def add_occupations(occupation_hash) occupation = CareerProfiles::Occupation.new_from_collection(occupation_hash) @occupations = occupation end
list_occupations()
click to toggle source
# File lib/career_profiles/career_interest.rb, line 24 def list_occupations puts "" @occupations.each.with_index(1) do |occupation, i| puts "#{i}. #{occupation.name}" end end