Sha256: f386c5782436e554740b98567c2fdde62524532b0387d7f871c9d929025fde9f
Contents?: true
Size: 414 Bytes
Versions: 33
Compression:
Stored size: 414 Bytes
Contents
# frozen_string_literal = true require 'erb' class Ree::RenderUtils def self.render(template, locals) new(locals).render(template) end def initialize(locals = {}) @render_binding = binding @locals = locals end def render(template) @locals.each { |variable, value| @render_binding.local_variable_set(variable, value) } ERB.new(template).result(@render_binding) end end
Version data entries
33 entries across 33 versions & 1 rubygems