Check out example codes for "ruby check if true". It will help you in understanding the concepts better.

Code Example 1

if variable
  # true
else
  # false

Learn ReactJs, React Native from akashmittal.com