Sha256: 9805b6cf912df3144b7b45d31ea00999e6431c16223394e8edf2b6c41303dd66

Contents?: true

Size: 663 Bytes

Versions: 1

Compression:

Stored size: 663 Bytes

Contents

module EffectiveEmailTemplates
  class EmailViewTemplate
    def initialize( effective_email_template )
      @effective_email_template = effective_email_template
    end

    attr_accessor :locals
    attr_reader :effective_email_template

    def render(view, locals, buffer=nil, &block)
      # The view object here is an anonymous view object (it has a class
      # of Class). It has all of the view helper methods inside of it.
      effective_email_template.render(view.assigns['to_liquid'])
    end

    def formats
      [:html]
    end

    def identifier
      effective_email_template.slug
    end

    def type
      formats.first
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
effective_email_templates-0.2.8 lib/effective_email_templates/email_view_template.rb