Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
if as modifier « Statement « Ruby
Ruby
Statement
if as modifier
1.
using if as a modifier with Boolean operator
2.
Output based on if statement
3.
test for equality:
4.
If the value of age is under 18, the string is printed to the screen.
5.
change the order: placing if after puts, and you can drop then and end.