Class: Hem::Lib::Seed::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/hem/lib/seed/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Template

Returns a new instance of Template.



5
6
7
# File 'lib/hem/lib/seed/template.rb', line 5

def initialize(config)
  @config = config
end

Instance Method Details

#configObject



9
10
11
# File 'lib/hem/lib/seed/template.rb', line 9

def config
  @config
end

#render(content, filename) ⇒ Object



13
14
15
16
17
# File 'lib/hem/lib/seed/template.rb', line 13

def render(content, filename)
  erb = ERB.new(content)
  erb.filename = filename
  erb.result binding
end