Wed, 02 Dec 2015 11:15:16 +0900 投稿
0

【Refactor Me】if else

Before

0 <= age or raise

if 0 <= age && age <= 2
  'baby'
elsif 3 <= age && age <= 6
  'little child'
elsif 7 <= age && age <= 12
  'child'
elsif 13 <= age && age <= 18
  'youth'
else
  'adult'
end

After

# your cool code

みんなのコメント