Handy Ruby Gem: andand
I came across a really useful Ruby gem today: andand. In PHP web development, I usually use this idiom when retrieving an object from the database model:
$obj = $model->getObject($id);
if(null !== $obj) {
doSomething($obj);
}
Obviously this is a little cumbersome, since I have to do this every single time I get an object [...]