Class: Htmless::Formatted

Inherits:
Standard show all
Defined in:
lib/htmless/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

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

Methods included from DynamicClasses

#create_dynamic_classes, #dynamic_classes, extended, #inherited

Constructor Details

This class inherits a constructor from Htmless::Abstract

Instance Method Details

- (Object) comment(comment)



37
38
39
40
41
# File 'lib/htmless/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