![]() We hope we refreshed your memory on checking values in Ruby. However #blank? and #present return a boolean for all objects, which might hide bugs in the code by not raising an error when a value is of the wrong type. ![]() For checking if a user has a name to address them with, #present? could be a good fit, for example. Since the naming of these methods tends to confuse, here's a handy cheat sheet for you to bookmark.Īs with everything, the choice between #nil?, #empty?, #blank? and #present? depends on the situation. ![]() Therefore, try to specify another standard, if one of them failed. It allows you to validate online a variety of Base64 standards. This is also a better method for validation than #empty? for the same reasons we covered for #blank?. The Base64 validator checks whether the submitted text is a valid Base64 encoded string.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |