Class: Lattice::Generator::ERBRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/lattice/generator.rb

Overview

Renders ERB file templates for generators

Instance Method Summary collapse

Constructor Details

#initialize(template, options) ⇒ ERBRenderer

Returns a new instance of ERBRenderer.



56
57
58
59
# File 'lib/lattice/generator.rb', line 56

def initialize(template, options)
  @template = template
  @options  = options
end

Instance Method Details

#app_const_baseObject



65
# File 'lib/lattice/generator.rb', line 65

def app_const_base; @options[:app_const_base]; end

#renderObject



61
62
63
# File 'lib/lattice/generator.rb', line 61

def render
  ERB.new(File.read(@template)).result(binding)
end