Class: Metanorma::Plugin::Glossarist::Document
- Inherits:
-
Object
- Object
- Metanorma::Plugin::Glossarist::Document
- Defined in:
- lib/metanorma/plugin/glossarist/document.rb
Instance Attribute Summary collapse
-
#file_system ⇒ Object
Returns the value of attribute file_system.
-
#registry ⇒ Object
Returns the value of attribute registry.
Instance Method Summary collapse
- #add_content(content, options = {}) ⇒ Object
-
#initialize ⇒ Document
constructor
A new instance of Document.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Document
Returns a new instance of Document.
9 10 11 |
# File 'lib/metanorma/plugin/glossarist/document.rb', line 9 def initialize @content = [] end |
Instance Attribute Details
#file_system ⇒ Object
Returns the value of attribute file_system.
7 8 9 |
# File 'lib/metanorma/plugin/glossarist/document.rb', line 7 def file_system @file_system end |
#registry ⇒ Object
Returns the value of attribute registry.
7 8 9 |
# File 'lib/metanorma/plugin/glossarist/document.rb', line 7 def registry @registry end |
Instance Method Details
#add_content(content, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/metanorma/plugin/glossarist/document.rb', line 13 def add_content(content, = {}) @content << if [:render] LiquidRendering.render( content, include_paths: [file_system, [:template]].compact, patterns: LiquidRendering::DOCUMENT_PATTERNS, registry: registry, ) else content end end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/metanorma/plugin/glossarist/document.rb', line 27 def to_s @content.compact.join("\n") end |