def can_drive(age) case age when 1..14 then 'no' when 15..100 then 'yes' end end
puts can_drive(18) # yes
I haven't used Ruby for a long time, and I don't feel bad about it.
def can_drive(age) case age when 1..14 then 'no' when 15..100 then 'yes' end end
puts can_drive(18) # yes
I haven't used Ruby for a long time, and I don't feel bad about it.