class method self.new

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

self.new( local, domain )

Address.new(local, domain)

Accepts:

  • local - Left of the at symbol

  • domain - Array of the domain split at the periods.

For example:

Address.new("mikel", ["lindsaar", "net"])
#=> "#<TMail::Address mikel@lindsaar.net>"

Parameters

local req
domain req
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb, line 137
    def initialize( local, domain )
      if domain
        domain.each do |s|
          raise SyntaxError, 'empty word in domain' if s.empty?
        end
      end
      
      # This is to catch an unquoted "@" symbol in the local part of the
      # address.  Handles addresses like <"@"@me.com> and makes sure they
      # stay like <"@"@me.com> (previously were becoming <@@me.com>)
      if local && (local.join == '@' || local.join =~ /\A[^"].*?@.*?[^"]\Z/)
        @local = "\"#{local.join}\""
      else
        @local = local
      end

      @domain = domain
      @name   = nil
      @routes = []
    end

Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb line 137 · View on GitHub · Improve this page · Find usages on GitHub

Defined in TMail::Address

Type at least 2 characters to search.

↑↓ navigate · open · esc close