class Rock::Doc::HTML::RenderingContext

Base class for rendering contexts

Attributes

default_template[R]
object[R]

Public Class Methods

new(object, *default_template) click to toggle source

Mapped object

# File lib/rock/doc.rb, line 130
def initialize(object, *default_template)
    @object = object
    @default_template = default_template
end

Public Instance Methods

help_tip(text) click to toggle source

No help tips by default, it relies on having specialized mechanisms too much

# File lib/rock/doc.rb, line 148
def help_tip(text); "" end
render(*template_path) click to toggle source
# File lib/rock/doc.rb, line 159
def render(*template_path)
    template_path += [binding]
    HTML.render_template(*template_path)
end
render_item(name, value = nil) click to toggle source

Create an item for the rendering in tables

# File lib/rock/doc.rb, line 151
def render_item(name, value = nil)
    if value
        "<li><b>#{name}</b>: #{value}</li>"
    else
        "<li><b>#{name}</b></li>"
    end
end
render_object(object, *template_path) click to toggle source
# File lib/rock/doc.rb, line 164
def render_object(object, *template_path)
    HTML.render_object(object, *template_path)
end