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
link_to(arg)
click to toggle source
No links by default
# File lib/rock/doc.rb, line 136 def link_to(arg) text = if arg.respond_to?(:name) arg.name else arg.to_s end Doc::HTML.escape_html(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