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

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

Constructor Details

#initialize(options = {}) ⇒ TransformerConfig

Returns a new instance of TransformerConfig.



167
168
169
170
171
172
173
# File 'lib/coradoc/configurable.rb', line 167

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



156
157
158
# File 'lib/coradoc/configurable.rb', line 156

def cache_enabled
  @cache_enabled
end

#enabled_transformersArray<Symbol>

Returns Enabled transformers.

Returns:

  • (Array<Symbol>)

    Enabled transformers



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

def enabled_transformers
  @enabled_transformers
end

#preserve_unknownBoolean

Returns Preserve unknown elements.

Returns:

  • (Boolean)

    Preserve unknown elements



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

def preserve_unknown
  @preserve_unknown
end

#validate_outputBoolean

Returns Validate after transformation.

Returns:

  • (Boolean)

    Validate after transformation



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

def validate_output
  @validate_output
end