Class: Mjml::MrmlParser
- Inherits:
-
Object
- Object
- Mjml::MrmlParser
- Defined in:
- lib/mjml/mrml_parser.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
-
#initialize(input) ⇒ MrmlParser
constructor
Create new parser.
-
#render ⇒ String
Render mjml template.
Constructor Details
#initialize(input) ⇒ MrmlParser
Create new parser
10 11 12 |
# File 'lib/mjml/mrml_parser.rb', line 10 def initialize(input) @input = input end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
5 6 7 |
# File 'lib/mjml/mrml_parser.rb', line 5 def input @input end |
Instance Method Details
#render ⇒ String
Render mjml template
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mjml/mrml_parser.rb', line 17 def render 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 |