Class: RTFDoc::Template
- Inherits:
-
Object
- Object
- RTFDoc::Template
- Defined in:
- lib/rtfdoc.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#page_title ⇒ Object
readonly
Returns the value of attribute page_title.
Instance Method Summary collapse
-
#initialize(sections, config) ⇒ Template
constructor
A new instance of Template.
- #output ⇒ Object
Constructor Details
#initialize(sections, config) ⇒ Template
Returns a new instance of Template.
116 117 118 119 120 121 |
# File 'lib/rtfdoc.rb', line 116 def initialize(sections, config) @content = sections.map(&:output).join @menu_content = sections.map(&:menu_output).join @app_name = config['app_name'] @page_title = config['title'] end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
114 115 116 |
# File 'lib/rtfdoc.rb', line 114 def app_name @app_name end |
#page_title ⇒ Object (readonly)
Returns the value of attribute page_title.
114 115 116 |
# File 'lib/rtfdoc.rb', line 114 def page_title @page_title end |
Instance Method Details
#output ⇒ Object
123 124 125 126 |
# File 'lib/rtfdoc.rb', line 123 def output template = Erubi::Engine.new(File.read(File.('../src/index.html.erb', __dir__))) eval(template.src) end |