Check out example codes for "ruby case assignment". It will help you in understanding the concepts better.
Code Example 1
#!/usr/bin/env ruby
trigger_value = 7
output_string = case trigger_value
when 1
"First number"
when 7
"Lucky number"
else
"Something else"
end
puts output_string # Outputs: Lucky number
Learn ReactJs, React Native from akashmittal.com