If x is non-nil : nil « Language Basics « Ruby






If x is non-nil


if x       # If x is non-nil
  puts x   # Then print it
end

 








Related examples in the same category

1.Compact an array: it removes the nils
2.Assign nil to array element
3.Is it a nil value
4.see if it is nil: