Sha256: 54455759c11b042bf3a07e80491c72d0aadaab08d4dfd15c6d1f35c95dc2427a

Contents?: true

Size: 412 Bytes

Versions: 16

Compression:

Stored size: 412 Bytes

Contents

require "liquid"

module HtmlEmailCreator
  class Layout
    def initialize(text, default_data = HtmlEmailCreator.settings.extension_data)
      @text = text
      @template = Liquid::Template.parse(text)
      @default_data = default_data
    end
        
    def to_html(data = {}, *filters)
      @template.render(@default_data.merge(data), :filters => [HtmlEmailCreator::Filters] + filters)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
html_email_creator-1.0.18 lib/html_email_creator/layout.rb
html_email_creator-1.0.16 lib/html_email_creator/layout.rb
html_email_creator-1.0.15 lib/html_email_creator/layout.rb
html_email_creator-1.0.14 lib/html_email_creator/layout.rb
html_email_creator-1.0.13 lib/html_email_creator/layout.rb
html_email_creator-1.0.10 lib/html_email_creator/layout.rb
html_email_creator-1.0.9 lib/html_email_creator/layout.rb
html_email_creator-1.0.8 lib/html_email_creator/layout.rb
html_email_creator-1.0.7 lib/html_email_creator/layout.rb
html_email_creator-1.0.6 lib/html_email_creator/layout.rb
html_email_creator-1.0.5 lib/html_email_creator/layout.rb
html_email_creator-1.0.4 lib/html_email_creator/layout.rb
html_email_creator-1.0.3 lib/html_email_creator/layout.rb
html_email_creator-1.0.2 lib/html_email_creator/layout.rb
html_email_creator-1.0.1 lib/html_email_creator/layout.rb
html_email_creator-1.0.0 lib/html_email_creator/layout.rb