Class: Maildrop::Models::Email

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

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Email

Returns a new instance of Email.



3
4
5
# File 'lib/maildrop/models/email.rb', line 3

def initialize(data)
  @mail = Mail.new(data['body'])
end

Instance Method Details

#bodyObject



19
20
21
# File 'lib/maildrop/models/email.rb', line 19

def body
  @mail.body.decoded
end

#dateObject



15
16
17
# File 'lib/maildrop/models/email.rb', line 15

def date
  @mail.date
end

#senderObject



7
8
9
# File 'lib/maildrop/models/email.rb', line 7

def sender
  @mail.from.first
end

#subjectObject



11
12
13
# File 'lib/maildrop/models/email.rb', line 11

def subject
  @mail.subject
end