Class: Malt::Format::Builder
- Defined in:
- lib/malt/formats/builder.rb
Overview
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.
To unite these different engines I have designated them a common file extension of ‘.rbml`.
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
- #builder ⇒ Object (also: #rbml)
- #html(*data, &content) ⇒ Object
- #to_builder ⇒ Object (also: #to_rbml)
- #to_html(*data, &content) ⇒ Object
Methods inherited from Abstract
#default, #engine, engine, extensions, #extensions, #file, file_extension, #file_read, #file_type, #parse_type_from_data, #refile, register, #render, #render_into, #rendering_parameters, #scope_vs_data, #subtype, #text, #to, #to_default, #to_s, #type, #with, #with!
Instance Method Details
#builder ⇒ Object Also known as: rbml
28 29 30 |
# File 'lib/malt/formats/builder.rb', line 28 def builder(*) text end |
#html(*data, &content) ⇒ Object
40 41 42 43 |
# 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 ⇒ Object Also known as: to_rbml
34 35 36 |
# File 'lib/malt/formats/builder.rb', line 34 def to_builder(*) self end |