Class: EmlToPdf::Email
- Inherits:
-
Object
- Object
- EmlToPdf::Email
- Defined in:
- lib/eml_to_pdf/email.rb
Constant Summary collapse
- MIME_TYPES =
{ plain_text: "text/plain", html: "text/html", multipart_alternative: "multipart/alternative" }
- TEMPLATES_PATH =
Pathname.new(File.(__dir__)) + "templates"
Instance Method Summary collapse
-
#initialize(input_path) ⇒ Email
constructor
A new instance of Email.
- #to_html ⇒ Object
Constructor Details
#initialize(input_path) ⇒ Email
Returns a new instance of Email.
16 17 18 19 |
# File 'lib/eml_to_pdf/email.rb', line 16 def initialize(input_path) @input_path = input_path @mail = Mail.read(input_path) end |
Instance Method Details
#to_html ⇒ Object
21 22 23 24 25 26 |
# File 'lib/eml_to_pdf/email.rb', line 21 def to_html html = text_parts(@mail).join html = (html, @mail.all_parts) html = (@mail, html) html end |