Class: Net::SMTP::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/net/smtp.rb

Overview

Address with parametres for MAIL or RCPT command

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, *args, **kw_args) ⇒ Address

:call-seq:

initialize(address, parameter, ...)

address String or Net::SMTP::Address parameter String or Hash



1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/net/smtp.rb', line 1141

def initialize(address, *args, **kw_args)
  if address.kind_of? Address
    @address = address.address
    @parameters = address.parameters
  else
    @address = address
    @parameters = []
  end
  @parameters = (parameters + args + [kw_args]).map{|param| Array(param)}.flatten(1).map{|param| Array(param).compact.join('=')}.uniq
end

Instance Attribute Details

#addressObject (readonly)

mail address [String]



1132
1133
1134
# File 'lib/net/smtp.rb', line 1132

def address
  @address
end

#parametersObject (readonly)

parameters [Array<String>]



1134
1135
1136
# File 'lib/net/smtp.rb', line 1134

def parameters
  @parameters
end

Instance Method Details

#to_sObject



1152
1153
1154
# File 'lib/net/smtp.rb', line 1152

def to_s
  @address
end