Class: SportDB::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/sportdb/templater.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Template

Returns a new instance of Template.



5
6
7
# File 'lib/sportdb/templater.rb', line 5

def initialize( path )
  @path = path
end

Instance Method Details

#render(binding) ⇒ Object



9
10
11
12
# File 'lib/sportdb/templater.rb', line 9

def render( binding )
  ## '<>' means omit newline for lines starting with <% and ending in %>
  ERB.new( load_template(), 0, '<>' ).result( binding )
end