Sha256: 688b7189f1eda5a90b2ac385345c69da595d4725ce04b1c0808fe07f1a566e6e
Contents?: true
Size: 449 Bytes
Versions: 11
Compression:
Stored size: 449 Bytes
Contents
require "ostruct" require "erb" module Picasa class Template attr_reader :name, :params def initialize(name, params) @name = name @params = params end def file @file ||= IO.read(::File.expand_path("../templates/#{name}.xml.erb", __FILE__)) end def struct @struct ||= OpenStruct.new(params) end def render ERB.new(file).result(struct.instance_eval { binding }) end end end
Version data entries
11 entries across 11 versions & 1 rubygems