Module: Webgen::ContentProcessor::Builder
- Defined in:
- lib/webgen/content_processor/builder.rb
Overview
Processes content that is valid Ruby to build an XML tree. This is done by using the builder library.
Class Method Summary collapse
-
.call(context) ⇒ Object
Process the content of
contextwhich needs to be valid Ruby code.
Class Method Details
.call(context) ⇒ Object
Process the content of context which needs to be valid Ruby code. The special variable xml should be used to construct the XML content.
15 16 17 18 19 20 |
# File 'lib/webgen/content_processor/builder.rb', line 15 def self.call(context) xml = ::Builder::XmlMarkup.new(:indent => 2) eval(context.content, binding, context.ref_node.alcn) context.content = xml.target! context end |