Class: Coradoc::Html::ConverterBase::ConfigurationBase

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/html/converter_base.rb

Overview

Base class for output converter configurations.

Provides shared ‘merge` and `defaults` patterns. Subclasses define `initialize`, `to_h`, and `validate!`.

Direct Known Subclasses

Spa::Configuration, Static::Configuration

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultsObject



31
32
33
# File 'lib/coradoc/html/converter_base.rb', line 31

def self.defaults
  new
end

Instance Method Details

#merge(other) ⇒ Object



35
36
37
38
# File 'lib/coradoc/html/converter_base.rb', line 35

def merge(other)
  other_hash = other.is_a?(self.class) ? other.to_h : other.to_h.transform_keys(&:to_sym)
  self.class.new(**to_h, **other_hash)
end