Module: NoNotifierNeeded::Render

Defined in:
lib/no_notifier_needed/render.rb

Instance Method Summary collapse

Instance Method Details

#render_erb(template_string) ⇒ Object



17
18
19
# File 'lib/no_notifier_needed/render.rb', line 17

def render_erb(template_string)
  ERB.new(template_string).result(binding)
end

#render_haml(template_string) ⇒ Object



13
14
15
# File 'lib/no_notifier_needed/render.rb', line 13

def render_haml(template_string)
  Haml::Engine.new(template_string).render(self)
end

#render_template_body_type(template) ⇒ Object



3
4
5
6
# File 'lib/no_notifier_needed/render.rb', line 3

def render_template_body_type(template)
  result = template.template_type == 'haml' ? render_haml(template.body) : render_erb(template.body)
  result.strip!
end

#render_template_subject_type(template) ⇒ Object



8
9
10
11
# File 'lib/no_notifier_needed/render.rb', line 8

def render_template_subject_type(template)
  result = template.template_type == 'haml' ? render_haml(template.subject) : render_erb(template.subject)
  result.strip!
end