Class: Trenni::MarkupTemplate::Assembler
- Inherits:
-
Template::Assembler
- Object
- Template::Assembler
- Trenni::MarkupTemplate::Assembler
- Defined in:
- lib/trenni/template.rb
Instance Attribute Summary
Attributes inherited from Template::Assembler
Instance Method Summary collapse
-
#expression(code) ⇒ Object
Output a string interpolation.
-
#text(text) ⇒ Object
Output raw text to the template.
Methods inherited from Template::Assembler
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 |