Class: Sunabamail::Mail
- Inherits:
-
Object
- Object
- Sunabamail::Mail
- Defined in:
- app/models/sunabamail/mail.rb
Instance Method Summary collapse
- #attachments ⇒ Object
- #has_html? ⇒ Boolean
- #has_text? ⇒ Boolean
- #html_body ⇒ Object
-
#initialize(raw) ⇒ Mail
constructor
A new instance of Mail.
- #text_body ⇒ Object
Constructor Details
Instance Method Details
#attachments ⇒ Object
34 |
# File 'app/models/sunabamail/mail.rb', line 34 def = . |
#has_html? ⇒ Boolean
12 13 14 15 16 |
# File 'app/models/sunabamail/mail.rb', line 12 def has_html? return true if html_part.present? "text/html" == mime_type end |
#has_text? ⇒ Boolean
6 7 8 9 10 |
# File 'app/models/sunabamail/mail.rb', line 6 def has_text? return true if text_part.present? "text/plain" == mime_type end |
#html_body ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/models/sunabamail/mail.rb', line 26 def html_body if multipart? decoded_body(html_part) elsif "text/html" == mime_type decoded_body() end end |
#text_body ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/models/sunabamail/mail.rb', line 18 def text_body if multipart? decoded_body(text_part) elsif "text/plain" == mime_type decoded_body() end end |