Class: Trenni::MarkupTemplate::Assembler

Inherits:
Template::Assembler show all
Defined in:
lib/trenni/template.rb

Instance Attribute Summary

Attributes inherited from Template::Assembler

#code

Instance Method Summary collapse

Methods inherited from Template::Assembler

#initialize, #instruction

Constructor Details

This class inherits a constructor from Trenni::Template::Assembler

Instance Method Details

#expression(code) ⇒ Object

Output a string interpolation.



153
154
155
# File 'lib/trenni/template.rb', line 153

def expression(code)
	@code << "#{OUT}<<(#{code});"
end

#text(text) ⇒ Object

Output raw text to the template.



158
159
160
161
# File 'lib/trenni/template.rb', line 158

def text(text)
	text = text.gsub("'", "\\\\'")
	@code << "#{OUT}.raw('#{text}');"
end