Module: Coradoc::ProcessorRegistry Private

Included in:
Input, Output
Defined in:
lib/coradoc/processor_registry.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Module adapter that gives a module Registry-backed processor methods.

Both Input and Output extend this module to get processor registration, lookup, and dispatch methods. All state is stored in a Registry instance.

Examples:

module Input
  extend ProcessorRegistry
  self.error_label = "input processor"
end

Instance Method Summary collapse

Instance Method Details

#define(processor, **options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
# File 'lib/coradoc/processor_registry.rb', line 27

def define(processor, **options)
  registry.define(processor, **options)
end

#error_label=(label) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/coradoc/processor_registry.rb', line 19

def error_label=(label)
  @error_label = label
end

#for_file(filename) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
# File 'lib/coradoc/processor_registry.rb', line 44

def for_file(filename)
  registry.for_file(filename)
end

#get(id) ⇒ Object Also known as: []

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def get(id)
  registry.get(id)
end

#process(content, options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



48
49
50
# File 'lib/coradoc/processor_registry.rb', line 48

def process(content, options = {})
  registry.process(content, options)
end

#processorsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
# File 'lib/coradoc/processor_registry.rb', line 40

def processors
  registry.items
end

#registered?(id) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


36
37
38
# File 'lib/coradoc/processor_registry.rb', line 36

def registered?(id)
  registry.registered?(id)
end

#registryObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
# File 'lib/coradoc/processor_registry.rb', line 23

def registry
  @registry ||= Registry.new(error_label: @error_label)
end