Class: Mailtruck::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/mailtruck/email.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Email

Returns a new instance of Email.



4
5
6
7
8
# File 'lib/mailtruck/email.rb', line 4

def initialize(attributes)
  [:to, :from, :subject, :html].each do |key|
    instance_variable_set "@#{key}", attributes[key.to_s]
  end
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



2
3
4
# File 'lib/mailtruck/email.rb', line 2

def from
  @from
end

#subjectObject

Returns the value of attribute subject.



2
3
4
# File 'lib/mailtruck/email.rb', line 2

def subject
  @subject
end

#toObject

Returns the value of attribute to.



2
3
4
# File 'lib/mailtruck/email.rb', line 2

def to
  @to
end

Instance Method Details

#bodyObject



10
11
12
# File 'lib/mailtruck/email.rb', line 10

def body
  @html
end