Module: Oga::XML::ElementToHAML

Defined in:
lib/epitools/gem_ext/oga.rb

Overview

Serialize this node to HAML

Instance Method Summary collapse

Instance Method Details

#prettyObject



13
14
15
16
# File 'lib/epitools/gem_ext/oga.rb', line 13

def pretty
  require 'coderay'
  puts CodeRay.scan(haml, :haml).term
end

#to_hamlObject Also known as: haml



6
7
8
9
10
# File 'lib/epitools/gem_ext/oga.rb', line 6

def to_haml
  require 'html2haml'
  require 'html2haml/html'
  Html2haml::HTML.new(to_xml, {}).render.rstrip
end