Class: EmlToPdf::MetadataContext
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- EmlToPdf::MetadataContext
- Defined in:
- lib/eml_to_pdf/metadata_context.rb
Instance Method Summary collapse
- #config ⇒ Object
- #format_attachment_size(attachment) ⇒ Object
- #format_date(date) ⇒ Object
- #get_binding ⇒ Object
- #html_escape(str) ⇒ Object
Instance Method Details
#config ⇒ Object
7 8 9 |
# File 'lib/eml_to_pdf/metadata_context.rb', line 7 def config EmlToPdf.configuration end |
#format_attachment_size(attachment) ⇒ Object
11 12 13 |
# File 'lib/eml_to_pdf/metadata_context.rb', line 11 def () Filesize.from("#{.body.decoded.size} B").pretty end |
#format_date(date) ⇒ Object
15 16 17 |
# File 'lib/eml_to_pdf/metadata_context.rb', line 15 def format_date(date) config.format_date(date) end |
#get_binding ⇒ Object
23 24 25 |
# File 'lib/eml_to_pdf/metadata_context.rb', line 23 def get_binding binding end |
#html_escape(str) ⇒ Object
19 20 21 |
# File 'lib/eml_to_pdf/metadata_context.rb', line 19 def html_escape(str) CGI.escapeHTML(str) end |