Check out example codes for "ruby case statement". It will help you in understanding the concepts better.

Code Example 1

case {condition}
when {option1}
  #do something
when {option2}
  #do something
else #default
  #do something else
end

Learn ReactJs, React Native from akashmittal.com