After the last rescue clause, guarantee contains a block of code that is always executed when the block ends. The assure block will be executed regardless of whether the block departs normally, raises and rescues an exception, or is terminated by an uncaught exception.
The ensure statement can be used to test for the existence of an object or value. If the object exists, it returns true, otherwise, it returns false.
The following are some benefits of using an ensure statement:
It can help you establish trust with your audience
It can help you create a sense of urgency in your writing
It allows you to make promises that are more specific than generalities
Some examples of using the ensure statement are:
Ensuring that you will not be liable for damages if the product breaks while being used.
Ensuring that you will cover all costs associated with the product's repair or replacement if it breaks.
Ensuring that you will pay for a product's return if it does not meet certain criteria.