Class: Resume::SkillSet

Inherits:
Object
  • Object
show all
Defined in:
lib/resume.rb

Overview

Represents all skills

Constant Summary collapse

@@categories =
{
    :languages=> "Languages",
    :apis=> "APIs",
    :tools=>"Tools",
    :databases=>"Databases",
    :operating_systems=>"OSes"
}
@@category_order =
[
    :languages,
    :apis,
    :tools,
    :databases,
    :operating_systems,
]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSkillSet

Returns a new instance of SkillSet.



141
142
143
# File 'lib/resume.rb', line 141

def initialize
    @skills = Hash.new
end

Instance Attribute Details

#skillsObject

Hash of category to skill objects



139
140
141
# File 'lib/resume.rb', line 139

def skills
  @skills
end

Class Method Details

.categoriesObject



130
# File 'lib/resume.rb', line 130

def SkillSet.categories; @@categories; end

.category_labels_orderObject

Returns the labels for the categories in order



132
133
134
135
136
# File 'lib/resume.rb', line 132

def SkillSet.category_labels_order
    labels = Array.new
    @@category_order.each() { |c| labels << @@categories[c] }
    labels
end

.category_orderObject



129
# File 'lib/resume.rb', line 129

def SkillSet.category_order; @@category_order; end

.scaffoldObject



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/resume.rb', line 162

def SkillSet.scaffold
    rand_skills = {
        :languages => "COBOL",
        :apis => "MOTIF",
        :tools => "Turbo Pascal",
        :databases => "Sybase",
        :operating_systems => "OS/2",
    }
    set = SkillSet.new
    @@category_order.each() do |c|
        set.skills[c] = Array.new
        set.skills[c] << Skill.scaffold(rand_skills[c])
    end
    set
end

Instance Method Details

#all_novice_skillsObject



145
146
147
148
149
150
151
# File 'lib/resume.rb', line 145

def all_novice_skills
    novice_skills = Array.new
    skills.each() do |k,v|
        novice_skills = novice_skills | v.select() { |x| x.experience_level == :novice }.sort().reverse()
    end
    novice_skills
end

#non_novice_skills_by_categoryObject

Returns a map of skill categories to arrays of skills



154
155
156
157
158
159
160
# File 'lib/resume.rb', line 154

def non_novice_skills_by_category
    non_novice = Hash.new
    SkillSet.category_order.each() do |category|
        non_novice[SkillSet.categories[category]] = skills[category].select() { |x| x.experience_level != :novice }.sort().reverse()
    end
    non_novice
end