Sha256: e25ab589f736e4363f8ee7b2eeeae15419af920174faea4e603ffe55dde4c471
Contents?: true
Size: 366 Bytes
Versions: 1
Compression:
Stored size: 366 Bytes
Contents
module MovieStone class Renderer def initialize(template_name) @template_file = File.expand_path("../templates/#{template_name}.erb", __FILE__) raise ArgumentError, "Template is invalid" unless File.exist? @template_file end def render(movie) @movie = movie ERB.new(File.read(@template_file)).result(binding) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
movie_stone-0.1.0 | lib/movie_stone/renderer.rb |