Learn Ruby
Online Store

Required parameter in method

Here is our code from the fahrenheit to celsius converter.

Let’s see what happens when we do not pass any argument to the new method.

We are getting an error because the new method is expecting a parameter. By default all parameters are required parameters. If a parameter is not passed to a method then that method will not work.