Sha256: 9298b89c14b82a2061f25a7fe7c5bf5ad3af3e9e46996165ae30fc8026b7c691
Contents?: true
Size: 456 Bytes
Versions: 5
Compression:
Stored size: 456 Bytes
Contents
# -*- coding: utf-8 -*- module TreeRb class ErbRender include ERB::Util attr_accessor :json_str def initialize(template_name, json_str) @template_name = template_name @json_str = json_str end def render() template_file_name = File.join(File.dirname(__FILE__), "templates", @template_name) template = File.read(template_file_name) ERB.new(template).result(binding) end end end # end module
Version data entries
5 entries across 5 versions & 1 rubygems