First page Back Continue Last page Overview Text

Notes:


The main difference is that the default value of the method argument has changed.

It's not common knowledge, but the default value of a method argument can be any ruby expression. In this case, we use the default argument to define a local variable named a

The only way that a can evaluate to true in this method is if no argument was provided, because that is the only way the default argument will be evaluated and a will be defined to true.

If you provide a nil argument to this method, v will be set to nil, but a will be nil instead of true, so you will still get the numeric expression instead of the column all.

Any questions on default arguments?