Class: Rager::Template::Providers::Erb

Inherits:
Abstract
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/rager/template/providers/erb.rb

Instance Method Summary collapse

Instance Method Details

#template(template, variables, options) ⇒ Object



19
20
21
22
23
# File 'lib/rager/template/providers/erb.rb', line 19

def template(template, variables, options)
  ERB.new(template).result_with_hash(variables)
rescue SyntaxError, NameError => e
  raise Rager::Errors::TemplateError.new(template, variables, details: e.message)
end