class LMDocstache::Renderer
Constants
- BLOCK_REGEX
Attributes
parser[R]
Public Class Methods
new(xml, data, options = {})
click to toggle source
# File lib/lm_docstache/renderer.rb, line 7 def initialize(xml, data, options = {}) @content = xml option_types = [:special_variable_replacements, :hide_custom_tags] @parser = Parser.new(xml, data, options.slice(*option_types)) end
Public Instance Methods
render()
click to toggle source
# File lib/lm_docstache/renderer.rb, line 13 def render parser.parse_and_update_document! @content end
render_replace(text)
click to toggle source
# File lib/lm_docstache/renderer.rb, line 18 def render_replace(text) @content.css('w|t').each do |text_el| if !(text_el.text.scan(/\|-Lawmatics Test-\|/)).empty? text_el.content = text end end @content end