Class: Maildis::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/maildis/sender.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, email) ⇒ Sender

Returns a new instance of Sender.



6
7
8
9
# File 'lib/maildis/sender.rb', line 6

def initialize(name, email)
  @name = name
  @email = email
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/maildis/sender.rb', line 4

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/maildis/sender.rb', line 4

def name
  @name
end

Instance Method Details

#to_emailObject



11
12
13
14
# File 'lib/maildis/sender.rb', line 11

def to_email
  return "#{@name} <#{@email}>" if @name
  @email
end