Parent

Methods

Class Index [+]

Quicksearch

Webgen::ContentProcessor::Builder

Processes content that is valid Ruby to build an XML tree. This is done by using the builder library.

Public Instance Methods

call(context) click to toggle source

Process the content of context which needs to be valid Ruby code. The special variable xml should be used to construct the XML content.

    # File lib/webgen/contentprocessor/builder.rb, line 13
13:     def call(context)
14:       require 'builder'
15: 
16:       xml = ::Builder::XmlMarkup.new(:indent => 2)
17:       eval(context.content, binding, context.ref_node.alcn)
18:       context.content = xml.target!
19:       context
20:     rescue LoadError
21:       raise Webgen::LoadError.new('builder', self.class.name, context.dest_node, 'builder')
22:     rescue Exception => e
23:       raise Webgen::RenderError.new(e, self.class.name, context.dest_node,
24:                                     Webgen::Common.error_file(e), Webgen::Common.error_line(e))
25:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.