I am looking for a concise way to check a value to see if it is nil or zero. Currently I am doing something like:
if (!val || val == 0) # Is nil or zero e
If you really like method names with question marks at the end:
if val.nil? || val.zero? # do stuff end
Your solution is fine, as are a few of the other solutions.
Ruby can make you search for a pretty way to do everything, if you're not careful.