Class: HammerBuilder::Formatted

Inherits:
Standard show all
Defined in:
lib/hammer_builder/formatted.rb

Overview

Builder implementation with formatting (indented by ‘ ’) Slow down is less then 1%

Instance Attribute Summary

Attributes inherited from Abstract

#_current

Instance Method Summary collapse

Methods inherited from Abstract

#cdata, #flush, #go_in, #html5, #initialize, #join, #js, #raw, #render, #reset, #set_variables, strings_injector, #text, #to_html

Methods included from DynamicClasses

#dynamic_classes, extended, #inherited

Constructor Details

This class inherits a constructor from HammerBuilder::Abstract

Instance Method Details

#comment(comment) ⇒ Object



37
38
39
40
41
# File 'lib/hammer_builder/formatted.rb', line 37

def comment(comment)
  flush
  @_output << @_str_newline << @_str_spaces.fetch(@_stack.size, @_str_space) << @_str_comment_start <<
      comment.to_s << @_str_comment_end
end