class Mjml::MrmlParser
Attributes
Public Class Methods
Source
# File lib/mjml/mrml_parser.rb, line 11 def initialize(template_path, input) @template_path = template_path @input = input @with_cache = Cache.new(template_path) end
Create new parser
@param template_path
[String] The path to the .mjml file @param input [String] The string to transform in html
Public Instance Methods
Source
# File lib/mjml/mrml_parser.rb, line 20 def render @with_cache.cache do MRML.to_html(input) rescue NameError Mjml.logger.fatal('MRML is not installed. Please add `gem "mrml"` to your Gemfile.') raise rescue StandardError raise if Mjml.raise_render_exception '' end end
Render mjml template
@return [String]