Object.blank? is a very simple construct, basically it just checks if an object is either nil or empty and does an error check to make sure that if empty doesn’t apply to an object it recovers gracefully. In a dynamically typed language like ruby constructs like these become very important to making sure that errors are handled elegantly and as expected, if a variable number of objects may be applied to the same block of code.

A basic implementation of Rails Object.blank? construct

Leave a Reply

Your email address will not be published. Required fields are marked *