Class: Coradoc::Configurable::TransformerConfig

Inherits:
ConfigSection show all
Defined in:
lib/coradoc/configurable.rb

Overview

Transformer configuration section

Instance Attribute Summary collapse

Attributes inherited from ConfigSection

#options

Instance Method Summary collapse

Methods inherited from ConfigSection

#[], #[]=, #after_initialize, #merge!, symbolize_keys, #to_h

Constructor Details

#initialize(options = {}) ⇒ TransformerConfig

Returns a new instance of TransformerConfig.



171
172
173
174
175
176
177
# File 'lib/coradoc/configurable.rb', line 171

def initialize(options = {})
  super
  @cache_enabled = @options.fetch(:cache_enabled, true)
  @preserve_unknown = @options.fetch(:preserve_unknown, true)
  @validate_output = @options.fetch(:validate_output, false)
  @enabled_transformers = @options.fetch(:enabled_transformers, [])
end

Instance Attribute Details

#cache_enabledBoolean

Returns Enable transformation caching.

Returns:

  • (Boolean)

    Enable transformation caching



160
161
162
# File 'lib/coradoc/configurable.rb', line 160

def cache_enabled
  @cache_enabled
end

#enabled_transformersArray<Symbol>

Returns Enabled transformers.

Returns:

  • (Array<Symbol>)

    Enabled transformers



169
170
171
# File 'lib/coradoc/configurable.rb', line 169

def enabled_transformers
  @enabled_transformers
end

#preserve_unknownBoolean

Returns Preserve unknown elements.

Returns:

  • (Boolean)

    Preserve unknown elements



163
164
165
# File 'lib/coradoc/configurable.rb', line 163

def preserve_unknown
  @preserve_unknown
end

#validate_outputBoolean

Returns Validate after transformation.

Returns:

  • (Boolean)

    Validate after transformation



166
167
168
# File 'lib/coradoc/configurable.rb', line 166

def validate_output
  @validate_output
end