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


1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/net/smtp.rb', line 1193

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

Instance Attribute Details

#addressObject (readonly)

mail address [String]


1184
1185
1186
# File 'lib/net/smtp.rb', line 1184

def address
  @address
end

#parametersObject (readonly)

parameters [Array<String>]


1186
1187
1188
# File 'lib/net/smtp.rb', line 1186

def parameters
  @parameters
end

Instance Method Details

#to_sObject


1203
1204
1205
# File 'lib/net/smtp.rb', line 1203

def to_s
  @address
end