Class: Malt::Formats::Rtals

Inherits:
Abstract show all
Defined in:
lib/malt/formats/rtals.rb

Instance Attribute Summary

Attributes inherited from Abstract

#options

Instance Method Summary collapse

Methods inherited from Abstract

#default, engine, #engine, #extensions, extensions, #file, #parse_type_and_data, #refile, register, #render, #subtype, #text, #to, #to_s, #type

Instance Method Details

#html(data, &yld) ⇒ Object



13
14
15
# File 'lib/malt/formats/rtals.rb', line 13

def html(data, &yld)
  render_engine.render(:text=>text, :data=>data, &yld)
end

#to_html(data, &yld) ⇒ Object



18
19
20
21
22
# File 'lib/malt/formats/rtals.rb', line 18

def to_html(data, &yld)
  text = html(data, &yld)
  opts = options.merge(:text=>text, :file=>refile(:html), :type=>:html)
  HTML.new(opts)
end

#to_xml(data, &yld) ⇒ Object



30
31
32
33
34
# File 'lib/malt/formats/rtals.rb', line 30

def to_xml(data, &yld)
  text = xml(data, &yld)
  opts = options.merge(:text=>text, :file=>refile(:xml), :type=>:xml)
  HTML.new(opts)
end

#xml(data, &yld) ⇒ Object



25
26
27
# File 'lib/malt/formats/rtals.rb', line 25

def xml(data, &yld)
  render_engine.render(:text=>text, :data=>data, &yld)
end