Module: Haml::HTML::Node

Included in:
Hpricot::BaseEle, Hpricot::Node
Defined in:
lib/haml/html.rb

Overview

A module containing utility methods that every Hpricot node should have.

Instance Method Summary collapse

Instance Method Details

#to_haml(tabs, options) ⇒ Object

Returns the Haml representation of the given node.

Parameters:

  • tabs (Fixnum)

    The indentation level of the resulting Haml.

Options Hash (options):

  • :rhtml (Boolean) — default: false

    Whether or not to parse ERB's <%= %> and <% %> into Haml's = and -

  • :xhtml (Boolean) — default: false

    Whether or not to parse the HTML strictly as XHTML



16
17
18
# File 'lib/haml/html.rb', line 16

def to_haml(tabs, options)
  parse_text(self.to_s, tabs)
end