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(input, options) ⇒ Object



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

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