Lets say you have a User class with your basic fields including prefix, first name, last name, and middle initial. None of these are required fields, though you want to display them a lot in your templates. You find yourself doing this alot:
Why? When methods and attributes are indistiguishable. Just add a little diddy to your User class.
"" [:prefix,:first_name,:middle_initial,:last_name].each do |name| display << send(name) << " " unless send(name).nil? end display.strip end display =
Isn't this prettier?