Sha256: 71fe3be9e476f042f8ce0ce8e9e73cd607d2db237d91954a6a07f96d3b04ce8b

Contents?: true

Size: 286 Bytes

Versions: 10

Compression:

Stored size: 286 Bytes

Contents

# frozen_string_literal: true

module BootstrapEmail
  class Erb
    def self.template(path, locals_hash = {})
      namespace = OpenStruct.new(locals_hash)
      template_html = File.read(path)
      ERB.new(template_html).result(namespace.instance_eval { binding })
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootstrap-email-1.5.1 lib/bootstrap-email/erb.rb
bootstrap-email-1.5.0 lib/bootstrap-email/erb.rb
bootstrap-email-1.4.1 lib/bootstrap-email/erb.rb
bootstrap-email-1.4.0 lib/bootstrap-email/erb.rb
bootstrap-email-1.3.1 lib/bootstrap-email/erb.rb
bootstrap-email-1.3.0 lib/bootstrap-email/erb.rb
bootstrap-email-1.2.0 lib/bootstrap-email/erb.rb
bootstrap-email-1.1.7 lib/bootstrap-email/erb.rb
bootstrap-email-1.1.6 lib/bootstrap-email/erb.rb
bootstrap-email-1.1.5 lib/bootstrap-email/erb.rb