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

Code Example 1

unless number.even?
  # runs if `number` is NOT even
else
  # runs if `number` is even
end

Code Example 2

if condition
	expression

Code Example 3

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

Learn ReactJs, React Native from akashmittal.com