Module: FunHtml::Writer
Overview
Writer collects the rendered elements and attributes into a string.
Instance Method Summary collapse
- #initialize ⇒ Object
-
#render ⇒ Object
Render produces the HTML string and clears the buffer.
Instance Method Details
#initialize ⇒ Object
12 13 14 |
# File 'lib/fun_html/writer.rb', line 12 def initialize @__buffer = +'' end |
#render ⇒ Object
Render produces the HTML string and clears the buffer.
17 18 19 20 21 22 |
# File 'lib/fun_html/writer.rb', line 17 def render @__buffer ensure # empty the buffer to prevent double rendering @__buffer = +'' end |