fixed case statement for ruby 2