Class: OpenxmlDocxTemplater::CodeLine
- Defined in:
- lib/openxml_docx_templater/line.rb
Direct Known Subclasses
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_code(code) ⇒ Object
47 48 49 |
# File 'lib/openxml_docx_templater/line.rb', line 47 def escape_code(code) code.mgsub(/'/ => "'", />/ => '>', /</ => '<', /"/ => '"', /&/ => '&') end |
#to_buf ⇒ Object
43 44 45 |
# File 'lib/openxml_docx_templater/line.rb', line 43 def to_buf "#{escape_code(@text)};" end |