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
Menu
Syntax of the full unless statement: : unless « Statement « Ruby
Ruby
Statement
unless
Syntax of the full unless statement:
unless Boolean [then | :] code ] [
else
code ] end
Related examples in the same category
1.
unless statement simply operates in the logically reverse sense from the if statement
2.
To get the opposite effect of if you can use the word unless:
3.
unless can work in exactly the same way because unless is just the opposite of if: