Class: HtmlFormatter::Builder

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

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

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



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/htmlformatter/builder.rb', line 14

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

  if options[:engine] == "eex"
    @embedded_indenter = ElixirIndenter.new
  else
    @embedded_indenter = RubyIndenter.new
  end
end