class Malt::Format::Builder
Builder
is the format common to Builder
, Markaby, Erector and Nokogiri's Builder
. Although there are some variant features between them, they all support the same general format. The format looks like a Markup
format, but is in fact a templating system built out of Ruby
code for creating XML/HTML documents.
@see builder.rubyforge.org/ @see markaby.rubyforge.org/ @see erector.rubyforge.org/ @see nokogiri.org/
To unite these different engines I have designated them a common file extension of `.rbml`.
Public Instance Methods
builder(*)
click to toggle source
# File lib/malt/formats/builder.rb, line 28 def builder(*) text end
Also aliased as: rbml
html(*data, &content)
click to toggle source
# File lib/malt/formats/builder.rb, line 40 def html(*data, &content) #render_engine.render(:to=>:html, :text=>text, :file=>file, :data=>data, &yld) render_into(:html, *data, &content) end
to_builder(*)
click to toggle source
# File lib/malt/formats/builder.rb, line 34 def to_builder(*) self end
Also aliased as: to_rbml
to_html(*data, &content)
click to toggle source
# File lib/malt/formats/builder.rb, line 46 def to_html(*data, &content) text = html(*data, &content) opts = options.merge(:text=>text, :file=>refile(:html), :type=>:html) HTML.new(opts) end