Class: LMDocstache::Renderer
- Inherits:
-
Object
- Object
- LMDocstache::Renderer
- Defined in:
- lib/lm_docstache/renderer.rb
Constant Summary collapse
- BLOCK_REGEX =
/\{\{([\#\^])([\w\.]+)(?:(\s(?:==|~=)\s?.+?))?\}\}.+?\{\{\/\k<2>\}\}/m
Instance Method Summary collapse
-
#initialize(xml, data) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
- #render_replace(text) ⇒ Object
Constructor Details
Instance Method Details
#render ⇒ Object
10 11 12 13 14 |
# File 'lib/lm_docstache/renderer.rb', line 10 def render (@content, @data) return @content end |
#render_replace(text) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/lm_docstache/renderer.rb', line 16 def render_replace(text) @content.css('w|t').each do |text_el| rendered_string = text_el.text if !(results = rendered_string.scan(/\|-Lawmatics Test-\|/)).empty? text_el.content = text end end return @content end |