small medium large xlarge

Generic-user-small
14 Jun 2010, 14:46
Abder-Rahman Hasan Ali (5 posts)

In page (87), the following is used in the price_must_be_at_least_a_cent method:

price.nil?

What is .nil? used for? Is it just a way to confirm that the value is NOT zero?

Thanks.

Samr_small_pragsmall
17 Jun 2010, 17:59
Sam Ruby (634 posts)

It checks for nil. nil is a different value than zero. In other languages this value is called null. Nil essentially means unassigned or no value.

You must be logged in to comment