Class: Malt::Format::RagTag

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

Overview

RagTag

http://github.com/rubyworks/ragtag

Instance Attribute Summary

Attributes inherited from Abstract

#options

Instance Method Summary collapse

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

#html(*data, &content) ⇒ Object


17
18
19
20
# File 'lib/malt/formats/ragtag.rb', line 17

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

#to_html(*data, &yld) ⇒ Object


23
24
25
26
27
# File 'lib/malt/formats/ragtag.rb', line 23

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


35
36
37
38
39
# File 'lib/malt/formats/ragtag.rb', line 35

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

#xml(*data, &yld) ⇒ Object


30
31
32
# File 'lib/malt/formats/ragtag.rb', line 30

def xml(*data, &yld)
  render_into(:xml, *data, &content)
end