Class: Canon::Config::PrettyPrinterConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/canon/config.rb

Overview

Pretty-printer sub-configuration for display canonicalization. Controls how documents are formatted by Canon::PrettyPrinter::Xml when display_preprocessing: :pretty_print is active. The two attributes (indent and indent_type) are backed by the parent DiffConfig‘s resolver so that ENV overrides (e.g. CANON_XML_DIFF_PRETTY_PRINTER_INDENT) work automatically.

Instance Method Summary collapse

Constructor Details

#initialize(resolver) ⇒ PrettyPrinterConfig

Returns a new instance of PrettyPrinterConfig.



271
272
273
# File 'lib/canon/config.rb', line 271

def initialize(resolver)
  @resolver = resolver
end

Instance Method Details

#indentObject



275
276
277
# File 'lib/canon/config.rb', line 275

def indent
  @resolver.resolve(:pretty_printer_indent)
end

#indent=(value) ⇒ Object



279
280
281
# File 'lib/canon/config.rb', line 279

def indent=(value)
  @resolver.set_programmatic(:pretty_printer_indent, value)
end

#indent_typeObject



283
284
285
# File 'lib/canon/config.rb', line 283

def indent_type
  @resolver.resolve(:pretty_printer_indent_type)
end

#indent_type=(value) ⇒ Object



287
288
289
# File 'lib/canon/config.rb', line 287

def indent_type=(value)
  @resolver.set_programmatic(:pretty_printer_indent_type, value)
end