class Malt::Format::Text
Plain text format. Plain text documents are uniqu in that they can be transformed into any other type of document. For example, applying to_html in text doesn't actually transform the source text in any way. Rather it simply “informs” Malt
to treat the text as HTML
.
Public Instance Methods
method_missing(sym, *args, &block)
click to toggle source
Calls superclass method
# File lib/malt/formats/text.rb, line 27 def method_missing(sym, *args, &block) if md = /^to_/.match(sym.to_s) type = md.post_match.to_sym opts = options.merge(:type=>type, :file=>refile(type)) return Malt.text(text, opts) end super(sym, *args, &block) end
to_txt(*)
click to toggle source
# File lib/malt/formats/text.rb, line 22 def to_txt(*) self end
txt(*)
click to toggle source
# File lib/malt/formats/text.rb, line 17 def txt(*) text end
Private Instance Methods
render_engine()
click to toggle source
Returns a PDF object.
def to_pdf
PDF.new(:text=>text,:file=>refile(:pdf))
end
# File lib/malt/formats/text.rb, line 48 def render_engine end