Class: RTFDoc::Template

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

Instance Method Summary collapse

Constructor Details

#initialize(sections) ⇒ Template

Returns a new instance of Template.



103
104
105
106
# File 'lib/rtfdoc.rb', line 103

def initialize(sections)
  @content = sections.map(&:output).join
  @menu_content = sections.map(&:menu_output).join
end

Instance Method Details

#outputObject



108
109
110
111
# File 'lib/rtfdoc.rb', line 108

def output
  template = Erubi::Engine.new(File.read(File.expand_path('../src/index.html.erb', __dir__)))
  eval(template.src)
end