Sha256: 78868946226d4bb59ae076b969ccc937202ab1b53004f2d8ffd0d56f4184689c
Contents?: true
Size: 412 Bytes
Versions: 32
Compression:
Stored size: 412 Bytes
Contents
# frozen_string_literal: true module DeepCover module Tools::RenderTemplate def render_template(template, bound_object) require 'erb' caller_path = Pathname.new(caller(1..1).first.partition(/\.rb:\d/).first).dirname template = caller_path.join("template/#{template}.html.erb").read erb = ERB.new(template) erb.result(bound_object.instance_eval { binding }) end end end
Version data entries
32 entries across 32 versions & 2 rubygems