Stupid Ruby Tricks
Friday, September 28th, 2007Problem: I wrote this line of code to record whether a record contains an email address:
enabled = not contact.card.email.nil?
I don’t like the “! something” or “not something” syntax in this case, since it’s really far away from the question I’m asking: “is the email nil?” I thought about it for a moment, and [...]