Skip to content

Instantly share code, notes, and snippets.

@Supernats
Created February 10, 2017 21:08
Show Gist options
  • Save Supernats/fdfa7db3cd4119df13c3b10f564ac73c to your computer and use it in GitHub Desktop.
Save Supernats/fdfa7db3cd4119df13c3b10f564ac73c to your computer and use it in GitHub Desktop.
def skills_in_roster(roster)
skills = roster.map { |_, skills_array| skills_array }.flatten.uniq
end
def developers_with_skill(skill, roster)
roster.select do |developer, developer_skills|
developer_skills.include?(skill)
end.
keys.map(&:to_s)
end
def skill_map(roster)
Hash[
skills_in_roster(roster).map do |skill|
[skill, developers_with_skill(skill, roster)]
end
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment