class Inline::Erb::TemplateRenderer

Public Class Methods

empty_binding() click to toggle source
# File lib/inline/erb.rb, line 7
def self.empty_binding
  binding
end
render(template_content, locals = {}) click to toggle source
# File lib/inline/erb.rb, line 11
def self.render(template_content, locals = {})
  b = empty_binding
  locals.each { |k, v| b.local_variable_set(k, v) }
  ERB.new(template_content).result(b)
end