Ruby/Language Basics/Code statement

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Group multiple expressions into a single expression

age = 24
puts "You"re NOT a teenager" unless age > 12 && age < 20



You don"t need any end-of-line marker at all in Ruby.

# If you can"t fit a Ruby statement on one line, 
# you can tell Ruby that you are continuing that line of code on a second line by using backslashes
 
puts \
"Hello from Ruby."