class Mjml::Handler

Public Instance Methods

call(template) click to toggle source
# File lib/mjml.rb, line 37
def call(template)
  compiled_source = haml_handler.call(template)
  if template.formats.include?(:html)
    "Mjml::Mjmltemplate.to_html(begin;#{compiled_source};end).html_safe"
  else
    compiled_source
  end
end
haml_handler() click to toggle source
# File lib/mjml.rb, line 33
def haml_handler
  @haml_handler ||= ActionView::Template.registered_template_handler(:haml)
end