Class: Asciidoctor::Extensions::Extension
- Inherits:
-
Object
- Object
- Asciidoctor::Extensions::Extension
- 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
Instance Attribute Summary collapse
- #config ⇒ Object readonly
- #instance ⇒ Object readonly
- #kind ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(kind, instance, config) ⇒ Extension
constructor
A new instance of Extension.
Constructor Details
#initialize(kind, instance, config) ⇒ Extension
Returns a new instance of Extension.
673 674 675 676 677 |
# File 'lib/asciidoctor/extensions.rb', line 673 def initialize kind, instance, config @kind = kind @instance = instance @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
670 671 672 |
# File 'lib/asciidoctor/extensions.rb', line 670 def config @config end |
#instance ⇒ Object (readonly)
671 672 673 |
# File 'lib/asciidoctor/extensions.rb', line 671 def instance @instance end |
#kind ⇒ Object (readonly)
669 670 671 |
# File 'lib/asciidoctor/extensions.rb', line 669 def kind @kind end |