# File lib/mail/fields/common/common_address.rb, line 72 def <<(val) case when val.nil? raise ArgumentError, "Need to pass an address to <<" when val.blank? parse(encoded) else parse((formatted + [val]).join(", ")) end end
Returns the address string of all the addresses in the address list
# File lib/mail/fields/common/common_address.rb, line 26 def addresses list = tree.addresses.map { |a| a.address } Mail::AddressContainer.new(self, list) end
Returns the actual address objects in the address list
# File lib/mail/fields/common/common_address.rb, line 44 def addrs list = tree.addresses Mail::AddressContainer.new(self, list) end
# File lib/mail/fields/common/common_address.rb, line 68 def default addresses end
Returns the display name of all the addresses in the address list
# File lib/mail/fields/common/common_address.rb, line 38 def display_names list = tree.addresses.map { |a| a.display_name } Mail::AddressContainer.new(self, list) end
Allows you to iterate through each address object in the syntax tree
# File lib/mail/fields/common/common_address.rb, line 19 def each tree.addresses.each do |address| yield(address) end end
Returns the formatted string of all the addresses in the address list
# File lib/mail/fields/common/common_address.rb, line 32 def formatted list = tree.addresses.map { |a| a.format } Mail::AddressContainer.new(self, list) end
Returns the addresses that are part of groups
# File lib/mail/fields/common/common_address.rb, line 59 def group_addresses groups.map { |k,v| v.map { |a| a.format } }.flatten end
Returns a hash of group name => address strings for the address list
# File lib/mail/fields/common/common_address.rb, line 50 def groups @groups = Hash.new tree.group_recipients.each do |group| @groups[group.group_name.text_value] = get_group_addresses(group.group_list) end @groups end
Generated with the Darkfish Rdoc Generator 2.