Sha256: d8255b05e284fc3364b295a6cb7633f3e305ed2b53164ce9a2f4682f46c74af3
Contents?: true
Size: 418 Bytes
Versions: 1
Compression:
Stored size: 418 Bytes
Contents
module Vmail module AddressQuoter def quote_addresses(string) return string email_addrs = [] string.scan(/\s*(.*?)\s*<(.+?)>(?:,|\Z)/) do |match| # yields ["Bob Smith", "bobsmith@gmail.com"] # then ["Jones, Rich A.", "richjones@gmail.com"] email_addrs << "\"#{match.first}\" <#{match.last}>" end res = email_addrs.join(", ") res end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vmail-1.3.4 | lib/vmail/address_quoter.rb |