Class: Gemstrap::Template

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/gemstrap/template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.render(template_path, hash) ⇒ Object



6
7
8
# File 'lib/gemstrap/template.rb', line 6

def self.render(template_path, hash)
  Template.new(hash).render(template_path)
end

Instance Method Details

#render(template_path) ⇒ Object



10
11
12
13
# File 'lib/gemstrap/template.rb', line 10

def render(template_path)
  template = ERB.new(IO.read(template_path))
  template.result(binding)
end