In Files
Parent
Information
Class Index
![show/hide quicksearch [+]](../../assets/icon/find.png)
- Malt
- Malt::Engine
- Malt::Engine::Abstract
- Malt::Engine::BlueCloth
- Malt::Engine::Builder
- Malt::Engine::Erb
- Malt::Engine::Erector
- Malt::Engine::Erubis
- Malt::Engine::Haml
- Malt::Engine::Kramdown
- Malt::Engine::Less
- Malt::Engine::Liquid
- Malt::Engine::Markaby
- Malt::Engine::Mustache
- Malt::Engine::RDiscount
- Malt::Engine::RDoc
- Malt::Engine::Radius
- Malt::Engine::Radius::context;
- Malt::Engine::RagTag
- Malt::Engine::RedCloth
- Malt::Engine::Ruby
- Malt::Engine::Sass
- Malt::Engine::Tenjin
- Malt::Format
- Malt::Format::Abstract
- Malt::Format::AbstractTemplate
- Malt::Format::Builder
- Malt::Format::CSS
- Malt::Format::Erb
- Malt::Format::Erector
- Malt::Format::HTML
- Malt::Format::Haml
- Malt::Format::LESS
- Malt::Format::Latex
- Malt::Format::Liquid
- Malt::Format::Markaby
- Malt::Format::Markdown
- Malt::Format::Mustache
- Malt::Format::PDF
- Malt::Format::RBHTML
- Malt::Format::RDoc
- Malt::Format::RHTML
- Malt::Format::Radius
- Malt::Format::RagTag
- Malt::Format::Ruby
- Malt::Format::SCSS
- Malt::Format::Sass
- Malt::Format::Tenjin
- Malt::Format::Text
- Malt::Format::Textile
- Malt::Format::UnsupportedConversion
- Malt::Format::XML
- Malt::Format::YAML
- Malt::Kernel
- Malt::Machine
- Malt::Markup
- Malt::NoEngineError
- Malt::Template
- Hash
- OpenStruct
Ruby
Yes, pure Ruby as a template format.
The ruby code is run through eval and whatever is returned is given as the rendering.
The Ruby format is a polyglot format —it accepts all conversion types and assumes the end-user knows it will be the result.
The Ruby type is also used for “precompiling” other formats such as ERB.
Public Instance Methods
method_missing(sym, *args, &yld)
click to toggle source
Ruby templates can be any type.
# File lib/malt/formats/ruby.rb, line 40 40: def method_missing(sym, *args, &yld) 41: if Malt::Format.registry.key?(sym) 42: return to(sym, *args, &yld).to_s 43: elsif md = /^to_/.match(sym.to_s) 44: type = md.post_match.to_sym 45: if Malt::Format.registry.key?(type) # TODO: Malt.machine.format? 46: return to(type, *args, &yld) 47: end 48: end 49: super(sym, *args, &yld) 50: end
rb(*)
click to toggle source
# File lib/malt/formats/ruby.rb, line 23 23: def rb(*) ; text ; end
Also aliased as: ruby
render(*type_and_data, &yld)
click to toggle source
def render_to(to, db, &yld)
malt_engine.render(text, file, db, &yld)
end
# File lib/malt/formats/ruby.rb, line 57 57: def render(*type_and_data, &yld) 58: type, data = parse_type_and_data(type_and_data) 59: render_engine.render(:text=>text, :file=>file, :data=>data, &yld) 60: end
to(type, data=nil, &yld)
click to toggle source
# File lib/malt/formats/ruby.rb, line 31 31: def to(type, data=nil, &yld) 32: new_class = Malt::Format.registry[type.to_sym] # TODO: Malt.machine.format? 33: new_text = render(data, &yld) 34: new_file = refile(type) 35: new_options = options.merge(:text=>new_text, :file=>new_file) 36: new_class.new(new_options) 37: end
to_rb(*)
click to toggle source
# File lib/malt/formats/ruby.rb, line 27 27: def to_rb(*) ; self ; end
Also aliased as: to_ruby
Disabled; run with --debug to generate this.