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.



174
175
176
177
178
179
180
# File 'lib/coradoc/configurable.rb', line 174

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



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

def cache_enabled
  @cache_enabled
end

#enabled_transformersArray<Symbol>

Returns Enabled transformers.

Returns:

  • (Array<Symbol>)

    Enabled transformers



172
173
174
# File 'lib/coradoc/configurable.rb', line 172

def enabled_transformers
  @enabled_transformers
end

#preserve_unknownBoolean

Returns Preserve unknown elements.

Returns:

  • (Boolean)

    Preserve unknown elements



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

def preserve_unknown
  @preserve_unknown
end

#validate_outputBoolean

Returns Validate after transformation.

Returns:

  • (Boolean)

    Validate after transformation



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

def validate_output
  @validate_output
end