Class: Malt::Format::Haml

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

Overview

Haml looks like a Markup format, but it turns out to be a template format too.

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

#hamlObject



14
15
16
# File 'lib/malt/formats/haml.rb', line 14

def haml(*)
  text
end

#html(*data, &content) ⇒ Object



24
25
26
# File 'lib/malt/formats/haml.rb', line 24

def html(*data, &content)
  render_into(:html, *data, &content)
end

#to_hamlObject



19
20
21
# File 'lib/malt/formats/haml.rb', line 19

def to_haml(*)
  self
end

#to_html(*data, &content) ⇒ Object



29
30
31
32
33
# File 'lib/malt/formats/haml.rb', line 29

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