class Template

Attributes

data[RW]

Data available to the ERB template

template[RW]

Absolute path to the ERB file

Public Class Methods

new(template_file) click to toggle source
# File lib/shot_mvc/template.rb, line 18
def initialize(template_file)
        @template = template_file
        @data = {}
end

Public Instance Methods

data=(data) click to toggle source
# File lib/shot_mvc/template.rb, line 28
def data=(data)
        @data.merge! data
end
render() click to toggle source
# File lib/shot_mvc/template.rb, line 23
def render
        template = ERB.new File.read @template
        template.result binding
end