Module: MRML
- Defined in:
- lib/mrml.rb,
lib/mrml/error.rb,
lib/mrml/version.rb,
lib/mrml/template.rb
Overview
Module that renders MJML templates into HTML/JSON using MRML, a reimplementation of the MJML markup language in Rust.
Defined Under Namespace
Constant Summary collapse
- VERSION =
'1.7.0'
Class Method Summary collapse
-
.to_hash(mjml) ⇒ Hash
Render template as Hash.
-
.to_html(mjml) ⇒ String
Render template as HTML.
-
.to_json(mjml) ⇒ String
Render template as JSON.
Class Method Details
.to_hash(mjml) ⇒ Hash
Render template as Hash.
47 48 49 50 51 52 |
# File 'lib/mrml.rb', line 47 def to_hash(mjml) return if mjml.nil? template = Template.new(mjml) template.to_hash end |