Sha256: 1d011ccf069ce89bfc856e39c43370ef4ccb078e1607a3339776fac9061b3962

Contents?: true

Size: 605 Bytes

Versions: 47

Compression:

Stored size: 605 Bytes

Contents

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

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

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

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

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
no_notifier_needed-2.4.5 lib/no_notifier_needed/render.rb
no_notifier_needed-2.4.4 lib/no_notifier_needed/render.rb
no_notifier_needed-2.4.3 lib/no_notifier_needed/render.rb
no_notifier_needed-2.4.2 lib/no_notifier_needed/render.rb
no_notifier_needed-2.4.1 lib/no_notifier_needed/render.rb
no_notifier_needed-2.4.0 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.8 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.7 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.6 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.5 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.4 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.3 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.2 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.1 lib/no_notifier_needed/render.rb
no_notifier_needed-2.3.0 lib/no_notifier_needed/render.rb
no_notifier_needed-2.2.4 lib/no_notifier_needed/render.rb
no_notifier_needed-2.2.3 lib/no_notifier_needed/render.rb
no_notifier_needed-2.2.2 lib/no_notifier_needed/render.rb
no_notifier_needed-2.2.1 lib/no_notifier_needed/render.rb
no_notifier_needed-2.2.0 lib/no_notifier_needed/render.rb