Parent

Methods

Class/Module 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 12
def call(context)
  require 'builder'

  xml = ::Builder::XmlMarkup.new(:indent => 2)
  eval(context.content, binding, context.ref_node.alcn)
  context.content = xml.target!
  context
rescue LoadError
  raise Webgen::LoadError.new('builder', self.class.name, context.dest_node, 'builder')
rescue Exception => e
  raise Webgen::RenderError.new(e, self.class.name, context.dest_node,
                                Webgen::Common.error_file(e), Webgen::Common.error_line(e))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.