Class: OpenxmlDocxTemplater::TextLine
- Defined in:
- lib/openxml_docx_templater/line.rb
Instance Attribute Summary
Attributes inherited from Line
Instance Method Summary collapse
Methods inherited from Line
code, #initialize, literal, string, text, #to_s
Constructor Details
This class inherits a constructor from OpenxmlDocxTemplater::Line
Instance Method Details
#escape_text(text) ⇒ Object
36 37 38 |
# File 'lib/openxml_docx_templater/line.rb', line 36 def escape_text text text.gsub(/['\\]/, '\\\\\&') end |
#to_buf ⇒ Object
32 33 34 |
# File 'lib/openxml_docx_templater/line.rb', line 32 def to_buf " _buf << '" << escape_text(@text) << "';" end |