address_lists.treetop - mail-2.5.4 Documentation

module Mail

    grammar AddressLists

      include RFC2822

      rule primary_address
        address_list {
          def addresses
            ([first_addr] + other_addr.elements.map { |o| o.addr_value }).reject { |e| e.empty? }
          end
        } / obs_addr_list {
          def addresses
            [first_addr] + other_addr.elements.map { |o| o.addr_value }
          end
        }
      end

    end

end