diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2018-12-06 13:53:50 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2018-12-06 13:53:50 -0800 |
commit | 731bfa7cf45b8b849e63990d933fc65a14a6b860 (patch) | |
tree | 0953a7e63b7288a3ee729de02ac2f6d1f9c44d65 /lib/action_mailbox/mail_ext | |
parent | a1d449e061d163fc0f6cb8c966d9ebf70923b665 (diff) | |
download | rails-731bfa7cf45b8b849e63990d933fc65a14a6b860.tar.gz rails-731bfa7cf45b8b849e63990d933fc65a14a6b860.tar.bz2 rails-731bfa7cf45b8b849e63990d933fc65a14a6b860.zip |
Add address wrapping
Makes it easier to deal with addresses that may already have been converted
Diffstat (limited to 'lib/action_mailbox/mail_ext')
-rw-r--r-- | lib/action_mailbox/mail_ext/address_wrapping.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/action_mailbox/mail_ext/address_wrapping.rb b/lib/action_mailbox/mail_ext/address_wrapping.rb new file mode 100644 index 0000000000..f41087a450 --- /dev/null +++ b/lib/action_mailbox/mail_ext/address_wrapping.rb @@ -0,0 +1,5 @@ +class Mail::Address + def self.wrap(address) + address.is_a?(Mail::Address) ? address : Mail::Address.new(address) + end +end |