Skip to content

Instantly share code, notes, and snippets.

@tlux
Created November 27, 2014 10:51
Show Gist options
  • Select an option

  • Save tlux/60a09b75e91129fba1f3 to your computer and use it in GitHub Desktop.

Select an option

Save tlux/60a09b75e91129fba1f3 to your computer and use it in GitHub Desktop.
Representation of a User's E-Mail-Adress in RFC5322 format
class User
def full_name
"#{first_name} #{last_name}"
end
def rfc5322
if full_name.present?
%{"#{full_name}" <#{email}>}
else
email
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment