Previous

Ruby case statement without arguments · 112 days ago

Like if…else poetry.

case
when false, nil
   puts "won't print"
when some_method # that also returns false or nil
  puts "still won't print"
when true, some_other_method # that doesn't return false or nil
  puts "There you go."
end

Sick.

Comments