Check out example codes for "if else ruby". It will help you in understanding the concepts better.
Code Example 1
x = 1
if x > 2
puts "x is greater than 2"
elsif x <= 2 and x!=0
puts "x is 1"
else
puts "I can't guess the number"
end
Code Example 2
if condition
expression
Code Example 3
if condition
expression
else
expression
Learn ReactJs, React Native from akashmittal.com