Class: Asciidoctor::Converter::CustomFactory

Inherits:
Object
  • Object
show all
Includes:
Factory
Defined in:
lib/asciidoctor/converter.rb

Direct Known Subclasses

DefaultFactoryProxy

Instance Method Summary collapse

Methods included from Factory

#converters, #create, create, default, #for, new, #register

Constructor Details

#initialize(seed_registry = nil) ⇒ CustomFactory

Returns a new instance of CustomFactory.



260
261
262
263
264
265
266
267
# File 'lib/asciidoctor/converter.rb', line 260

def initialize seed_registry = nil
  if seed_registry
    seed_registry.default = seed_registry.delete '*'
    @registry = seed_registry
  else
    @registry = {}
  end
end

Instance Method Details

#unregister_allvoid

This method returns an undefined value.

Unregister all Converter classes that are registered with this factory. Intended for testing only.



272
273
274
# File 'lib/asciidoctor/converter.rb', line 272

def unregister_all
  registry.clear.default = nil
end