Class: Maildrop::Models::Email
- Inherits:
-
Object
- Object
- Maildrop::Models::Email
- Defined in:
- lib/maildrop/models/email.rb
Instance Method Summary collapse
- #body ⇒ Object
- #date ⇒ Object
-
#initialize(data) ⇒ Email
constructor
A new instance of Email.
- #sender ⇒ Object
- #subject ⇒ Object
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
#body ⇒ Object
19 20 21 |
# File 'lib/maildrop/models/email.rb', line 19 def body @mail.body.decoded end |
#date ⇒ Object
15 16 17 |
# File 'lib/maildrop/models/email.rb', line 15 def date @mail.date end |
#sender ⇒ Object
7 8 9 |
# File 'lib/maildrop/models/email.rb', line 7 def sender @mail.from.first end |
#subject ⇒ Object
11 12 13 |
# File 'lib/maildrop/models/email.rb', line 11 def subject @mail.subject end |