Class: BootstrapEmail::Erb

Inherits:
Object
  • Object
show all
Defined in:
lib/bootstrap-email/erb.rb

Class Method Summary collapse

Class Method Details

.template(path, locals_hash = {}) ⇒ Object



5
6
7
8
9
# File 'lib/bootstrap-email/erb.rb', line 5

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