Sha256: 4ae7fa5b4c317cad49f9b87689dfe21bdfd365f343713fbd7dfe82c5bab2a663

Contents?: true

Size: 452 Bytes

Versions: 9

Compression:

Stored size: 452 Bytes

Contents

require "filesize"
require "cgi"
require "ostruct"

module EmlToPdf
  class MetadataContext < OpenStruct
    def config
      EmlToPdf.configuration
    end

    def format_attachment_size(attachment)
      Filesize.from("#{attachment.body.decoded.size} B").pretty
    end

    def format_date(date)
      config.format_date(date)
    end

    def html_escape(str)
      CGI.escapeHTML(str)
    end

    def get_binding
      binding
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
eml_to_pdf-0.5.0 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf-0.4.1 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.8 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.7 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.6 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.5 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.4 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.3 lib/eml_to_pdf/metadata_context.rb
eml_to_pdf_ext-0.5.2 lib/eml_to_pdf/metadata_context.rb