Class: Asciidoctor::Extensions::Extension

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoctor/extensions.rb

Overview

Extension is a proxy object for an extension implementation such as a processor. It allows the preparation of the extension instance to be separated from its usage to provide consistency between different interfaces and avoid tight coupling with the extension type.

The proxy encapsulates the extension kind (e.g., :block), its config Hash and the extension instance. This Proxy is what gets stored in the extension registry when activated. – QUESTION call this ExtensionInfo?

Direct Known Subclasses

ProcessorExtension

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, instance, config) ⇒ Extension

Returns a new instance of Extension.



660
661
662
663
664
# File 'lib/asciidoctor/extensions.rb', line 660

def initialize kind, instance, config
  @kind = kind
  @instance = instance
  @config = config
end

Instance Attribute Details

#configObject (readonly)



657
658
659
# File 'lib/asciidoctor/extensions.rb', line 657

def config
  @config
end

#instanceObject (readonly)



658
659
660
# File 'lib/asciidoctor/extensions.rb', line 658

def instance
  @instance
end

#kindObject (readonly)



656
657
658
# File 'lib/asciidoctor/extensions.rb', line 656

def kind
  @kind
end