Class: HtmlBeautifier::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/htmlbeautifier/builder.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  indent: "  ",
  initial_level: 0,
  stop_on_errors: false,
  keep_blank_lines: 0
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(output, options = {}) ⇒ Builder

Returns a new instance of Builder.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/htmlbeautifier/builder.rb', line 15

def initialize(output, options = {})
  options = DEFAULT_OPTIONS.merge(options)
  @tab = options[:indent]
  @stop_on_errors = options[:stop_on_errors]
  @level = options[:initial_level]
  @keep_blank_lines = options[:keep_blank_lines]
  @new_line = false
  @empty = true
  @ie_cc_levels = []
  @output = output
  @embedded_indenter = RubyIndenter.new
end