Condense the case statement in cal.rb for readability