Consider the following code:
age = 10 puts "You're too young to use this system" if age < 18
If the value of age is under 18, the string is printed to the screen.
The following code is equivalent:
age = 10 if age < 18 # w ww .j ava 2 s.c o m puts "You're too young to use this system" end
To put any number of lines of code in between the if statement and the end line:
age = 10 if age < 18 # from w w w . j av a2 s . c om puts "You're too young to use this system" puts "So we're going to exit your program now" exit end