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(nodes, config) ⇒ Template
constructor
A new instance of Template.
- #output ⇒ Object
Constructor Details
#initialize(nodes, config) ⇒ Template
Returns a new instance of Template.
134 135 136 137 138 139 140 141 |
# File 'lib/rtfdoc.rb', line 134 def initialize(nodes, config) @content = nodes.flat_map(&:output).join # @menu_content = nodes.map(&:menu_output).join @app_name = config['app_name'] @page_title = config['title'] (nodes) end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
132 133 134 |
# File 'lib/rtfdoc.rb', line 132 def app_name @app_name end |
#page_title ⇒ Object (readonly)
Returns the value of attribute page_title.
132 133 134 |
# File 'lib/rtfdoc.rb', line 132 def page_title @page_title end |
Instance Method Details
#output ⇒ Object
143 144 145 146 |
# File 'lib/rtfdoc.rb', line 143 def output template = Erubi::Engine.new(File.read(File.('../src/index.html.erb', __dir__))) eval(template.src) end |