Syntax of the full unless statement: : unless « Statement « Ruby





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: