Class: Net::SMTP::Address
- Inherits:
-
Object
- Object
- Net::SMTP::Address
- Defined in:
- lib/net/smtp.rb
Overview
Address with parametres for MAIL or RCPT command
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
mail address [String].
-
#parameters ⇒ Object
readonly
parameters [Array<String>].
Instance Method Summary collapse
-
#initialize(address, *args, **kw_args) ⇒ Address
constructor
:call-seq: initialize(address, parameter, …).
- #to_s ⇒ Object
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
#address ⇒ Object (readonly)
mail address [String]
1132 1133 1134 |
# File 'lib/net/smtp.rb', line 1132 def address @address end |
#parameters ⇒ Object (readonly)
parameters [Array<String>]
1134 1135 1136 |
# File 'lib/net/smtp.rb', line 1134 def parameters @parameters end |
Instance Method Details
#to_s ⇒ Object
1152 1153 1154 |
# File 'lib/net/smtp.rb', line 1152 def to_s @address end |