A single block within a Page object. The content of the block can be rendered using the render method.
Render the block using the provided context object.
The context object needs to respond to #[] and #[]= (e.g. a Hash is a valid context object) and the key :processors needs to contain a Hash which maps processor names to processor objects that respond to #call.
Uses the content processors specified in the pipeline key of the options attribute to do the actual rendering.
Returns the given context with the rendered content.
# File lib/webgen/page.rb, line 37 def render(context) context[:content] = @content.dup context[:block] = self @options['pipeline'].to_s.split(/,/).each do |processor| raise "No such content processor available: #{processor}" unless context[:processors].has_key?(processor) context[:processors][processor].call(context) end context end
Generated with the Darkfish Rdoc Generator 2.