Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Am I this this in a nicer way?
if employee_skills.has_key?(skill_name) then
employee_skills[skill_name] += 1
else
employee_skills[skill_name] = 1
end
@pete-a

This comment has been minimized.

Copy link

pete-a commented Oct 24, 2012

employee_skills[skill_name] ||= 0
employee_skills[skill_name] += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.