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
46 47 48 |
# File 'lib/openxml_docx_templater/line.rb', line 46 def escape_code code code.mgsub! [[/'/, "'"], [/>/, '>'], [/</, '<'], [/"/, '"'], [/&/, '&']] end |
#to_buf ⇒ Object
42 43 44 |
# File 'lib/openxml_docx_templater/line.rb', line 42 def to_buf escape_code(@text) << ';' end |