Method: Custom#code
- Defined in:
- lib/xhtml_report_generator/custom.rb
#code(attrs = {}, &block) ⇒ REXML::Element
Appends a
node after the @current node
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/xhtml_report_generator/custom.rb', line 130 def code(attrs={}, &block) temp = REXML::Element.new("pre") temp.add_attributes(attrs) @div_middle.insert_after(@current, temp) @current = temp raise "Block argument is mandatory" unless block_given? text = encoding_fixer(block.call()) @current.add_text(text) return @current end |