Class: Haml::HTML::ERB

Inherits:
Erubis::Basic::Engine
  • Object
show all
Defined in:
lib/haml/html/erb.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.compile(template) ⇒ Object



8
9
10
# File 'lib/haml/html/erb.rb', line 8

def self.compile(template)
  new(template).src
end

Instance Method Details

#add_expr_debug(src, code) ⇒ Object



34
35
36
# File 'lib/haml/html/erb.rb', line 34

def add_expr_debug(src, code)
  raise "html2haml doesn't support debugging expressions."
end

#add_expr_literal(src, code) ⇒ Object



29
30
31
32
# File 'lib/haml/html/erb.rb', line 29

def add_expr_literal(src, code)
  src << '<haml:loud>' << h(code) << '</haml:loud>'
  src << '<haml:block>' if block_opener?(code)
end

#add_postamble(src) ⇒ Object



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

def add_postamble(src); end

#add_preamble(src) ⇒ Object



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

def add_preamble(src); end

#add_stmt(src, code) ⇒ Object



23
24
25
26
27
# File 'lib/haml/html/erb.rb', line 23

def add_stmt(src, code)
  src << '</haml:block>' if block_closer?(code) || mid_block?(code)
  src << '<haml:silent>' << h(code) << '</haml:silent>' unless code.strip == "end"
  src << '<haml:block>' if block_opener?(code) || mid_block?(code)
end

#add_text(src, text) ⇒ Object



19
20
21
# File 'lib/haml/html/erb.rb', line 19

def add_text(src, text)
  src << text
end

#escaped_expr(code) ⇒ Object



12
13
14
# File 'lib/haml/html/erb.rb', line 12

def escaped_expr(code)
  raise "html2haml doesn't support escaped expressions."
end